Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(desktop): await main window show and focus on startup

Richie McIlroy880866614446
diff --git a/apps/desktop/src/routes/(window-chrome).tsx b/apps/desktop/src/routes/(window-chrome).tsx
index c092f6ea6..95fde7a10 100644
--- a/apps/desktop/src/routes/(window-chrome).tsx
+++ b/apps/desktop/src/routes/(window-chrome).tsx
@@ -25,11 +25,14 @@ export default function (props: RouteSectionProps) {
__CAP__?: { initialTargetMode?: unknown };
};
const hasInitialTargetMode = __CAP__?.initialTargetMode != null;
+ const currentWindow = getCurrentWindow();
if (location.pathname === "/") {
void emit("main-window-ready");
}
- if (location.pathname === "/" && !hasInitialTargetMode)
- getCurrentWindow().show();
+ if (location.pathname === "/" && !hasInitialTargetMode) {
+ await currentWindow.show();
+ await currentWindow.setFocus();
+ }
});
onCleanup(() => {