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:
co-authored by
CodeRabbit
coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
parent
a94a986fbf
commit
f38835ceee
+10
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user