mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-11-09 07:23:14 +00:00
28 lines
782 B
TypeScript
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();
|
|
}
|