Add a consolidated single export to each app

This commit is contained in:
James Babcock committed 2026-08-03 00:51:57 -07:00
1 parent 9b3832d7a7
commit f38366df6e
23 files changed
+597 -337

No files matched your search

+10 -2
View File
@@ -1,4 +1,5 @@
import { NotificationsListLayer } from "../../ui/notifications";
import { onAndroidNotificationPosted } from "../../native/notification-icons";
import {
createInProcessWindow,
YieldAtRootLayer,
@@ -15,7 +16,9 @@ export const NOTIFICATIONS_SURFACE_ID = "window:notifications";
* opens the detail view with its quick actions.
*/
export function createNotificationsAppWindow(options: InProcessAppOptions): InProcessWindow {
return createInProcessWindow({
// Newly posted notifications repaint the list while the window is open.
let offNotificationPosted: (() => void) | null = null;
const created = createInProcessWindow({
appId: "notifications",
windowId: NOTIFICATIONS_WINDOW_ID,
title: "Notifications",
@@ -27,6 +30,11 @@ export function createNotificationsAppWindow(options: InProcessAppOptions): InPr
submitFrame: options.submitFrame,
setSurfaceVisible: options.setSurfaceVisible,
removeSurface: options.removeSurface,
onClosed: options.onClosed,
onClosed: () => {
offNotificationPosted?.();
options.onClosed();
},
});
offNotificationPosted = onAndroidNotificationPosted(() => created.requestRender());
return created;
}