File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ class CinnamonNotificationsApplet extends Applet.TextIconApplet {
4949 // States
5050 this . _blinking = false ;
5151 this . _blink_toggle = false ;
52+ this . _clearing = false ;
5253
5354 this . _display ( ) ;
5455 }
@@ -181,7 +182,8 @@ class CinnamonNotificationsApplet extends Applet.TextIconApplet {
181182 let i = this . notifications . indexOf ( notification ) ;
182183 if ( i != - 1 )
183184 this . notifications . splice ( i , 1 ) ;
184- this . update_list ( ) ;
185+ if ( ! this . _clearing )
186+ this . update_list ( ) ;
185187 } ) ;
186188 notification . _timeLabel . show ( ) ;
187189
@@ -245,9 +247,14 @@ class CinnamonNotificationsApplet extends Applet.TextIconApplet {
245247 _clear_all ( ) {
246248 let count = this . notifications . length ;
247249 if ( count > 0 ) {
248- for ( let i = count - 1 ; i >= 0 ; i -- ) {
249- this . _notificationbin . remove_actor ( this . notifications [ i ] . actor ) ;
250- this . notifications [ i ] . destroy ( NotificationDestroyedReason . DISMISSED ) ;
250+ this . _clearing = true ;
251+ try {
252+ for ( let i = count - 1 ; i >= 0 ; i -- ) {
253+ this . _notificationbin . remove_actor ( this . notifications [ i ] . actor ) ;
254+ this . notifications [ i ] . destroy ( NotificationDestroyedReason . DISMISSED ) ;
255+ }
256+ } finally {
257+ this . _clearing = false ;
251258 }
252259 }
253260 this . notifications = [ ] ;
You can’t perform that action at this time.
0 commit comments