fix(desktop): update from the splash only after the user clicks (#3280)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-08 17:25:34 +02:00
1 parent f1373a63c3
commit 7937d5f802
90 files changed
+6888 -11255

No files matched your search

+17 -4
View File
@@ -2,13 +2,16 @@
export const DESKTOP_MODULE_CHANNELS = Object.freeze({
ensure: 'desktop-modules:ensure',
pendingUpdate: 'desktop-modules:pending-update',
applyPendingUpdate: 'desktop-modules:apply-pending-update',
confirmLaunch: 'desktop-modules:confirm-launch',
} as const);
export const DESKTOP_MODULE_EVENTS = Object.freeze({
pendingUpdateChanged: 'desktop-modules:pending-update-changed',
export const DESKTOP_UPDATE_CHANNELS = Object.freeze({
state: 'desktop-update:state',
start: 'desktop-update:start',
} as const);
export const DESKTOP_UPDATE_EVENTS = Object.freeze({
stateChanged: 'desktop-update:state-changed',
} as const);
const DESKTOP_MODULE_NAME_PATTERN = /^[a-z][a-z0-9_]{0,63}$/u;
@@ -55,6 +58,16 @@ export interface DesktopModuleAPI {
confirmLaunch?: () => Promise<void>;
}
export interface DesktopUpdateState {
readonly available: boolean;
}
export interface DesktopUpdateAPI {
state: () => Promise<DesktopUpdateState>;
start: () => Promise<void>;
onStateChanged: (listener: (state: DesktopUpdateState) => void) => () => void;
}
export function isDesktopModuleName(value: unknown): value is string {
return typeof value === 'string' && DESKTOP_MODULE_NAME_PATTERN.test(value);
}