mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-24 14:55:37 +00:00
25 lines
713 B
TypeScript
25 lines
713 B
TypeScript
import type { BrowserWindow } from "electron";
|
|
|
|
export function createRecordingEditorNavigation(createEditor: () => void) {
|
|
let returnWindow: BrowserWindow | null = null;
|
|
return {
|
|
setReturnWindow(window: BrowserWindow | null) {
|
|
returnWindow = window;
|
|
},
|
|
open(reload = true) {
|
|
const target = returnWindow;
|
|
if (reload) returnWindow = null;
|
|
if (!target || target.isDestroyed()) {
|
|
createEditor();
|
|
return;
|
|
}
|
|
// Home flushed this editor's project before launching the HUD. Reload
|
|
// from the finalized recording session, clearing the previous project UI.
|
|
if (reload) target.reload();
|
|
if (target.isMinimized()) target.restore();
|
|
target.show();
|
|
target.focus();
|
|
},
|
|
};
|
|
}
|