1
0
forked from PGL/Clyde

timer on notifications

This commit is contained in:
Debucquoy Anthony 2024-04-22 09:09:53 +02:00
parent af8bc8872d
commit 060526c20d
Signed by untrusted user: tonitch
GPG Key ID: A78D6421F083D42E

View File

@ -2,9 +2,14 @@ import { ref } from 'vue'
import { restGet, restPost } from '@/rest/restConsumer.js'
export const notifications = ref([]);
let timerSet = false
export function fetchNotifications(){
restGet("/notifications").then( e => notifications.value = e );
if(!timerSet){
timerSet = true;
setTimeout(() => {timerSet = false; fetchNotifications()}, 5000);
}
}
export function archiveNotification(id){