Skip to content

The VS Code of video editing, built for agents.

TypeScript

Enhance app launch functionality and update route key

konstantin-paulus7d9d2330a503
diff --git a/apps/cli/src/cli-client.ts b/apps/cli/src/cli-client.ts
index a6dbf310..bd576f7f 100644
--- a/apps/cli/src/cli-client.ts
+++ b/apps/cli/src/cli-client.ts
@@ -81,11 +81,16 @@ export function isAppDown(e: unknown): boolean {
* Launches the app, or surfaces the running instance: `open -a` on a running
* app only activates it, so this is safe to always run. macOS only; elsewhere
* it resolves false and the caller falls through to the connection.
+ *
+ * The bundled `dapi` runs as Electron with ELECTRON_RUN_AS_NODE=1, and `open`
+ * hands its environment to the app it launches — left in, the app boots as
+ * plain Node and never answers.
*/
export function launchApp(background: boolean): Promise<boolean> {
if (process.platform !== "darwin") return Promise.resolve(false);
const args = background ? ["-g", "-a", APP_NAME, "--args", "--hidden"] : ["-a", APP_NAME];
- return new Promise((res) => execFile("open", args, (err) => res(!err)));
+ const { ELECTRON_RUN_AS_NODE: _, ...env } = process.env;
+ return new Promise((res) => execFile("open", args, { env }, (err) => res(!err)));
}
/**
diff --git a/apps/web/src/lib/persist-route.tsx b/apps/web/src/lib/persist-route.tsx
index a3ed9a94..d7343a0e 100644
--- a/apps/web/src/lib/persist-route.tsx
+++ b/apps/web/src/lib/persist-route.tsx
@@ -6,7 +6,7 @@ import { createEffect } from "solid-js";
import { useLocation } from "@solidjs/router";
import { store } from "@/init";
-const ROUTE_KEY = "last-route";
+const ROUTE_KEY = "last-route.v2";
// Query params that trigger one-shot UI (dialogs) and must not replay on relaunch.
const TRANSIENT_PARAMS = ["checkout"];