fix: add platform abstraction for deeplink (#251)

* fix: add platform abstraction for deeplink

This was crashing App.tsx due to the deep link listener calling methods on window which do not exist.

* fix: apply CodeRabbit auto-fixes

Fixed 1 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <[email protected]>

* log error

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <[email protected]>
This commit was merged in pull request #251.
This commit is contained in:
Arjun Patel
2026-06-09 10:01:22 -07:00
committed by GitHub
co-authored by CodeRabbit coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
parent a94a986fbf
commit f38835ceee
5 changed files with 28 additions and 8 deletions
+10 -4
View File
@@ -56,10 +56,16 @@ function DeepLinkNavigationListener() {
const navigate = useNavigate();
useEffect(() => {
window.electronDeepLink.getPending().then((path) => {
if (path) navigate(path);
});
return window.electronDeepLink.onNavigate((path) => navigate(path));
platform.deepLink
.getPending()
.then((path) => {
if (path) navigate(path);
})
.catch((err) => {
logError(err, { scope: 'deepLink.getPending' });
});
return platform.deepLink.onNavigate((path) => navigate(path));
}, [navigate]);
return null;