Files
webadderall eaf87be95b Recordly 2.0 local review stack 2/6
Dependency-ordered review preparation. Not pushed or remotely reviewed.
2026-11-06 05:24:21 +11:00

28 lines
782 B
TypeScript

interface ActivationWindow {
isDestroyed(): boolean;
isVisible(): boolean;
isMinimized(): boolean;
}
/** Desktop icons reopen the current controls without raising an unrelated Home window. */
export function activateFromDesktopIcon(options: {
stopRecording: () => boolean;
getPriorityWindow: () => ActivationWindow | null;
getHudWindow: () => ActivationWindow | null;
showHud: () => void;
showMain: () => void;
}): void {
if (options.stopRecording()) return;
const priorityWindow = options.getPriorityWindow();
if (priorityWindow && !priorityWindow.isDestroyed()) {
options.showMain();
return;
}
const hud = options.getHudWindow();
if (hud && !hud.isDestroyed() && hud.isVisible() && !hud.isMinimized()) {
options.showHud();
return;
}
options.showMain();
}