diff --git a/app/components/Sidebar/components/HistoryNavigation.tsx b/app/components/Sidebar/components/HistoryNavigation.tsx index 09d236af0c..46f49e77dd 100644 --- a/app/components/Sidebar/components/HistoryNavigation.tsx +++ b/app/components/Sidebar/components/HistoryNavigation.tsx @@ -44,12 +44,12 @@ function HistoryNavigation(props: React.ComponentProps) { return ( - Desktop.bridge.goBack()}> + Desktop.bridge?.goBack()}> - Desktop.bridge.goForward()}> + Desktop.bridge?.goForward()}> diff --git a/app/hooks/useDesktopTitlebar.ts b/app/hooks/useDesktopTitlebar.ts index e745f0a2b9..937c514c31 100644 --- a/app/hooks/useDesktopTitlebar.ts +++ b/app/hooks/useDesktopTitlebar.ts @@ -3,7 +3,7 @@ import Desktop from "~/utils/Desktop"; export const useDesktopTitlebar = () => { React.useEffect(() => { - if (!Desktop.isElectron()) { + if (!Desktop.bridge) { return; } @@ -19,7 +19,7 @@ export const useDesktopTitlebar = () => { } event.preventDefault(); - await Desktop.bridge.onTitlebarDoubleClick(); + await Desktop.bridge?.onTitlebarDoubleClick(); }; window.addEventListener("dblclick", handleDoubleClick); diff --git a/app/scenes/Login/urls.ts b/app/scenes/Login/urls.ts index c4d7e33e4f..fe5612453e 100644 --- a/app/scenes/Login/urls.ts +++ b/app/scenes/Login/urls.ts @@ -37,6 +37,6 @@ export async function navigateToSubdomain(subdomain: string) { .trim() .replace(/^https?:\/\//, ""); const host = `https://${normalizedSubdomain}.getoutline.com`; - await Desktop.bridge.addCustomHost(host); + await Desktop.bridge?.addCustomHost(host); window.location.href = host; } diff --git a/app/typings/window.d.ts b/app/typings/window.d.ts index 2517af21ee..1bce9039e5 100644 --- a/app/typings/window.d.ts +++ b/app/typings/window.d.ts @@ -14,7 +14,7 @@ declare global { stores: RootStore; - DesktopBridge: { + DesktopBridge?: { /** * The name of the platform running on. */