Messaging system #150

Merged
tonitch merged 15 commits from tonitch/Clyde:msg into master 2024-04-09 17:08:59 +02:00
Showing only changes of commit 2b9bdf8dac - Show all commits

View File

@ -15,6 +15,7 @@ import { ref } from 'vue'
*/ */
export const discussionsList = ref(); export const discussionsList = ref();
export const currentDiscussion = ref([]); export const currentDiscussion = ref([]);
let timerSet = false
export async function createDiscussion(name){ export async function createDiscussion(name){
@ -50,6 +51,10 @@ async function fetchDiscussions(){
export async function fetchDiscussion(id){ export async function fetchDiscussion(id){
currentDiscussion.value = await restGet("/discussion/" + id); currentDiscussion.value = await restGet("/discussion/" + id);
if(!timerSet){
timerSet = true;
setTimeout(() => {timerSet = false;fetchDiscussion(currentDiscussion.value.id)} , 5000);
}
} }
await fetchDiscussions(); await fetchDiscussions();