mirror of
https://github.com/outline/outline.git
synced 2026-12-06 11:12:32 +03:00
fix: Error in non-Outline Electron browser, improved typings
This commit is contained in:
1 parent
e2355d63a2
commit
f8535ff047
4 files changed
+6
-6
No files matched your search
@@ -44,12 +44,12 @@ function HistoryNavigation(props: React.ComponentProps<typeof Flex>) {
|
||||
return (
|
||||
<Navigation gap={4} {...props}>
|
||||
<Tooltip content={t("Go back")} delay={500}>
|
||||
<NudeButton onClick={() => Desktop.bridge.goBack()}>
|
||||
<NudeButton onClick={() => Desktop.bridge?.goBack()}>
|
||||
<Back $active={back} />
|
||||
</NudeButton>
|
||||
</Tooltip>
|
||||
<Tooltip content={t("Go forward")} delay={500}>
|
||||
<NudeButton onClick={() => Desktop.bridge.goForward()}>
|
||||
<NudeButton onClick={() => Desktop.bridge?.goForward()}>
|
||||
<Forward $active={forward} />
|
||||
</NudeButton>
|
||||
</Tooltip>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Vendored
+1
-1
@@ -14,7 +14,7 @@ declare global {
|
||||
|
||||
stores: RootStore;
|
||||
|
||||
DesktopBridge: {
|
||||
DesktopBridge?: {
|
||||
/**
|
||||
* The name of the platform running on.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user