-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix deep link opening when window is closed #1633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
.bundle |
michaelneale
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conditionally approved - @matthewdiamant were you able to test it by building into .app - as I think deep links only work when packaged (in any case - a bundle should be available here shortly).
| let firstOpenWindow: BrowserWindow; | ||
| let pendingDeepLink = null; // Store deep link if sent before React is ready | ||
| app.on('open-url', async (event, url) => { | ||
| event.preventDefault(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is ok to remove this? (actually never sure why it was there in the first place)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to test deep links without packaging the app, just the regular npm start dev mode environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OH WOW - @matthewdiamant I wish I had known this months ago!
macOS ARM64 Desktop App (Apple Silicon)📱 Download macOS Desktop App (arm64, signed) Instructions: This link is provided by nightly.link and will work even if you're not logged into GitHub. |
* upstream/main: feat(google_drive): move credentials into keychain, add optional fallback (block#1603) feat: add session list command in cli (block#1586) feat: google sheets support (in google drive builtin MCP server) (block#1601) fix: deep link opening when window is closed (block#1633) docs: edits to docker guide (block#1639) feat: ollama tool shim (block#1448) feat: add write approve mode (block#1628) ui: auto update card upon config (block#1610) fix: fix tool output expansion checks (block#1634) fix: remove conditional that breaks output display for tool calls (block#1631) docs: Persistent Command History (block#1627) change to make build work on windows, macos, linux (block#1618) chore(release): release version 1.0.13 (block#1623) fix: handle mac screenshots with the image tool (block#1622) feat: write eval results to eval dir (block#1620) [fix] fix model config logging to remove api key (block#1619) fix: ensure repeating benches return to initial run-dir (block#1617)
Fixes #1534
When clicking a deep link, sometimes the window is closed. We open up a new window, and then wait until that window has loaded to send a message to the renderer to open an extension link.
The issue is that even though the window has loaded, React has not loaded, so it misses this message.
Instead, we need React to tell the main process that it is ready. So, create a
reactReadycall that does this. This might be useful later on for other needs as well (deep link or otherwise).Then, when the main process gets a
react-readymessage, if there is apendingDeepLink, it sends the message to the renderer to open the extension link.