timer on notifications
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	
This commit is contained in:
		@ -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){
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user