File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ export const useNotifications = (): NotificationsState => {
7474
7575 const previousNotifications = notifications ;
7676 const fetchedNotifications = await getAllNotifications ( state ) ;
77+ setNotifications ( fetchedNotifications ) ;
7778
7879 // Set Global Error if all accounts have the same error
7980 const allAccountsHaveErrors =
@@ -104,21 +105,16 @@ export const useNotifications = (): NotificationsState => {
104105 fetchedNotifications ,
105106 ) ;
106107
107- // If there are no new notifications just stop there
108- if ( ! diffNotifications . length ) {
109- return ;
110- }
111-
112- if ( state . settings . playSound ) {
113- raiseSoundNotification ( state . settings . notificationVolume / 100 ) ;
114- }
108+ if ( diffNotifications . length > 0 ) {
109+ if ( state . settings . playSound ) {
110+ raiseSoundNotification ( state . settings . notificationVolume / 100 ) ;
111+ }
115112
116- if ( state . settings . showNotifications ) {
117- raiseNativeNotification ( diffNotifications ) ;
113+ if ( state . settings . showNotifications ) {
114+ raiseNativeNotification ( diffNotifications ) ;
115+ }
118116 }
119117
120- setNotifications ( fetchedNotifications ) ;
121-
122118 setStatus ( 'success' ) ;
123119 } ,
124120 [ notifications ] ,
You can’t perform that action at this time.
0 commit comments