Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

fix(desktop): load overlay windows from the dev server in development

Luis Ortizf4f2a7a7099f
diff --git a/apps/desktop/src/main/overlay/index.ts b/apps/desktop/src/main/overlay/index.ts
index 3a6d3a6..5be924b 100644
--- a/apps/desktop/src/main/overlay/index.ts
+++ b/apps/desktop/src/main/overlay/index.ts
@@ -38,7 +38,10 @@ function overlayWindow(bounds: Electron.Rectangle, hash: string, interactive: bo
win.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
win.setContentProtection(true);
if (!interactive) win.setIgnoreMouseEvents(true);
- win.loadFile(rendererFile(), { hash }).catch((error) => {
+ const load = process.env.ELECTRON_RENDERER_URL
+ ? win.loadURL(`${process.env.ELECTRON_RENDERER_URL}/overlay.html#${hash}`)
+ : win.loadFile(rendererFile(), { hash });
+ load.catch((error) => {
process.stderr.write(`overlay window ${hash} failed to load: ${error}\n`);
});
return win;