Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions apps/array/src/main/services/deep-link/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@ export class DeepLinkService {
return;
}

// Register the protocol
// Skip protocol registration in development to avoid hijacking deep links
// from the production app. OAuth uses HTTP callback in dev mode anyway.
if (process.defaultApp) {
// Development: need to register with path to electron
if (process.argv.length >= 2) {
app.setAsDefaultProtocolClient(PROTOCOL, process.execPath, [
process.argv[1],
]);
}
} else {
// Production
app.setAsDefaultProtocolClient(PROTOCOL);
log.info(
"Skipping protocol registration in development (using HTTP callback for OAuth)",
);
return;
}

// Production: register the protocol
app.setAsDefaultProtocolClient(PROTOCOL);

this.protocolRegistered = true;
log.info(`Registered '${PROTOCOL}' protocol handler`);
}
Expand Down