Clear notification popups when they're dismissed on the phone, and avoid showing some notifications that are spurious

This commit is contained in:
James Babcock committed 2026-10-14 02:05:23 -07:00
1 parent 42c2d5cd55
commit bf92a5a2ce
17 files changed
+422 -70

No files matched your search

+11
View File
@@ -74,6 +74,17 @@ export class NotificationModalQueue<M> {
this.openNext(current.wokeScreen);
}
/**
* The notification went away on the phone (its source cancelled it, or it
* was dismissed there). Drops it from the queue, and returns the open modal
* if that is the one showing it, for the host to close (via closed()).
*/
withdrawn(notificationKey: string): M | null {
const index = this.queued.findIndex((entry) => entry.notificationKey === notificationKey);
if (index >= 0) this.queued.splice(index, 1);
return this.current?.notificationKey === notificationKey ? this.current.modal : null;
}
/** Notifications waiting behind the open modal (for diagnostics and tests). */
queuedKeys(): string[] {
return this.queued.map((entry) => entry.notificationKey);