@@ -99,6 +99,7 @@ import Notification from './Components/Notification.vue'
9999import  NcButton  from  ' @nextcloud/vue/dist/Components/NcButton.js' 
100100import  Close  from  ' vue-material-design-icons/Close.vue' 
101101import  axios  from  ' @nextcloud/axios' 
102+ import  { getCurrentUser  } from  ' @nextcloud/auth' 
102103import  { subscribe , unsubscribe  } from  ' @nextcloud/event-bus' 
103104import  { showError  } from  ' @nextcloud/dialogs' 
104105import  { loadState  } from  ' @nextcloud/initial-state' 
@@ -233,20 +234,28 @@ export default {
233234			this .hasNotifyPush  =  true  
234235		} 
235236
236- 		//  Setup  the background checker 
237+ 		//  Set up  the background checker 
237238		this ._setPollingInterval (this .pollIntervalBase ) 
238239
239240		this ._watchTabVisibility () 
240241		subscribe (' networkOffline' this .handleNetworkOffline ) 
241242		subscribe (' networkOnline' this .handleNetworkOnline ) 
243+ 		subscribe (' user_status:status.updated' this .userStatusUpdated ) 
242244	}, 
243245
244246	beforeDestroy () { 
247+ 		unsubscribe (' user_status:status.updated' this .userStatusUpdated ) 
245248		unsubscribe (' networkOffline' this .handleNetworkOffline ) 
246249		unsubscribe (' networkOnline' this .handleNetworkOnline ) 
247250	}, 
248251
249252	methods:  { 
253+ 		userStatusUpdated (state ) { 
254+ 			if  (getCurrentUser ().uid  ===  state .userId ) { 
255+ 				this .userStatus  =  state .status  
256+ 			} 
257+ 		}, 
258+ 
250259		onOpen () { 
251260			this .focusFirstFocusable () 
252261			this .requestWebNotificationPermissions () 
0 commit comments