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
@@ -55,4 +55,9 @@ export const electronPlatform: Platform = {
|
||||
setDockBadge: (count) => window.electronApp.setDockBadge(count),
|
||||
getVersion: () => window.electronApp.getVersion(),
|
||||
},
|
||||
|
||||
deepLink: {
|
||||
getPending: () => window.electronDeepLink.getPending(),
|
||||
onNavigate: (cb) => window.electronDeepLink.onNavigate(cb),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -60,6 +60,11 @@ export interface Platform {
|
||||
setDockBadge: (count: number) => void;
|
||||
getVersion: () => Promise<string>;
|
||||
};
|
||||
|
||||
deepLink: {
|
||||
getPending: () => Promise<string | null>;
|
||||
onNavigate: (callback: (path: string) => void) => () => void;
|
||||
};
|
||||
}
|
||||
|
||||
export const DESKTOP_DOWNLOAD_URL = 'https://flowylabs.ai/llink/download';
|
||||
|
||||
@@ -117,4 +117,11 @@ export const webPlatform: Platform = {
|
||||
setDockBadge: applyDockBadge,
|
||||
getVersion: async () => __APP_VERSION__,
|
||||
},
|
||||
|
||||
deepLink: {
|
||||
getPending: () => Promise.resolve(null),
|
||||
onNavigate: (_) => {
|
||||
return () => {};
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user