diff --git a/frontend/src/rest/notifications.js b/frontend/src/rest/notifications.js index 31d0319..e3919db 100644 --- a/frontend/src/rest/notifications.js +++ b/frontend/src/rest/notifications.js @@ -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){