Files
Recordly/electron/updatePresentation.ts
T
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

29 lines
868 B
TypeScript

type UpdatePhase = "available" | "downloading" | "ready" | "error";
export function getUpdatePresentation({
phase,
recording,
editorVisible,
notifyOnOpen,
platform,
notificationVisible = false,
automaticDownloads = false,
}: {
phase?: UpdatePhase;
recording: boolean;
editorVisible: boolean;
notifyOnOpen: boolean;
platform: string;
notificationVisible?: boolean;
automaticDownloads?: boolean;
}): "silent" | "inline" | "notification" | "native" {
if (!phase || recording) return "silent";
if (notificationVisible && platform === "darwin") return "notification";
if (phase === "downloading") return editorVisible ? "inline" : "silent";
if (notifyOnOpen && (phase === "ready" || (phase === "available" && !automaticDownloads))) {
return platform === "darwin" ? "notification" : "native";
}
if (editorVisible) return "inline";
return "silent";
}