diff --git a/src/renderer/components/layout/topbar.tsx b/src/renderer/components/layout/topbar.tsx index 404a4fec7d..d90f11c04f 100644 --- a/src/renderer/components/layout/topbar.tsx +++ b/src/renderer/components/layout/topbar.tsx @@ -28,6 +28,9 @@ import { webContents } from "@electron/remote"; import { observable } from "mobx"; import { ipcRendererOn } from "../../../common/ipc"; import { watchHistoryState } from "../../remote-helpers/history-updater"; +import { isActiveRoute, navigate } from "../../navigation"; +import { catalogRoute, catalogURL } from "../../../common/routes"; +import { previousActiveTab } from "../+catalog"; interface Props extends React.HTMLAttributes { } @@ -68,6 +71,10 @@ export const TopBar = observer(({ children, ...rest }: Props) => { ); }; + const goHome = () => { + navigate(`${catalogURL()}/${previousActiveTab.get()}`); + }; + const goBack = () => { webContents.getAllWebContents().find((webContent) => webContent.getType() === "window")?.goBack(); }; @@ -85,6 +92,13 @@ export const TopBar = observer(({ children, ...rest }: Props) => { return (
+