[Notifications] Improve handling of centre

This commit is contained in:
Janis Hutz 2025-03-22 14:28:31 +01:00
parent 709af40296
commit 7ff986e7a6

View File

@ -59,7 +59,11 @@ class Notifier implements Subscribable {
private show ( id: number ) { private show ( id: number ) {
this.set( id, Notification( { this.set( id, Notification( {
notification: this.notifications.get( id )!, notification: this.notifications.get( id )!,
onHoverLost: () => this.hide( id ), onHoverLost: () => {
if ( !this.menuOpen ) {
this.hide( id );
}
},
setup: () => timeout( TIMEOUT_DELAY, () => { setup: () => timeout( TIMEOUT_DELAY, () => {
if ( !this.menuOpen ) { if ( !this.menuOpen ) {
this.hide( id ); this.hide( id );
@ -100,6 +104,9 @@ class Notifier implements Subscribable {
this.hide( id ); this.hide( id );
this.notifications.get( id )?.dismiss(); this.notifications.get( id )?.dismiss();
this.notifications.delete( id ); this.notifications.delete( id );
if ( this.notifications.size == 0 ) {
this.menuOpen = false;
}
} }
openNotificationMenu () { openNotificationMenu () {