fix(desktop): recover deep-link URL from argv on win/linux cold start

setupDeepLinks() only listened for second-instance and open-url events.
On Windows/Linux a fresh launch via `surfsense://` delivers the URL in
argv of the first instance, where it was silently dropped. Scan argv on
setup so the existing handlePendingDeepLink() pass picks it up.
This commit is contained in:
CREDO23 2026-05-22 18:39:22 +02:00
parent d97b2830c5
commit 6ee7c04d02

View file

@ -60,6 +60,11 @@ export function setupDeepLinks(): boolean {
app.setAsDefaultProtocolClient(PROTOCOL); app.setAsDefaultProtocolClient(PROTOCOL);
} }
// Cold-start on Windows/Linux: protocol URL arrives via argv of the
// first instance, not via `second-instance` or `open-url`.
const cold = process.argv.find((arg) => arg.startsWith(`${PROTOCOL}://`));
if (cold) handleDeepLink(cold);
return true; return true;
} }