timer on notifications
This commit is contained in:
parent
af8bc8872d
commit
060526c20d
@ -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){
|
||||
|
Loading…
Reference in New Issue
Block a user