refactor: extract application construction and lifecycle

This commit is contained in:
Sameh Khamis committed 2026-09-11 17:02:54 -07:00
1 parent 092f28e301
commit 4d37760314
36 files changed
+1363 -382

No files matched your search

+9 -1
View File
@@ -643,5 +643,13 @@ export function initFirstRunExperience({
}
syncToExclusiveSurfaces();
return { dismiss, isTopmost };
// Teardown is not a user dismissal and must not change the show preference.
const destroy = () => {
closing = true;
documentRef.removeEventListener('keydown', onKeyDown, true);
globalThis.removeEventListener?.('resize', onViewportResize);
surfaceObserver?.disconnect();
root.remove();
};
return { dismiss, isTopmost, destroy };
}