Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(native-buttons): runtime errors due to missing functions
Elian Doranef6410f25d62
diff --git a/src/public/app/desktop.js b/src/public/app/desktop.jsindex cbd5b6f796..c07040a243 100644--- a/src/public/app/desktop.js+++ b/src/public/app/desktop.js@@ -62,15 +62,16 @@ function initTitleBarButtons() {const color = style.getPropertyValue("--native-titlebar-background");const symbolColor = style.getPropertyValue("--native-titlebar-foreground");- if (color && symbolColor) {- // FIXME, do this only on windows- // currentWindow.setTitleBarOverlay({ color, symbolColor });+ if (window.glob.platform === "win32" && color && symbolColor) {+ currentWindow.setTitleBarOverlay({ color, symbolColor });}// FIXME: call only on darwin- const xOffset = parseInt(style.getPropertyValue("--native-titlebar-darwin-x-offset"), 10);- const yOffset = parseInt(style.getPropertyValue("--native-titlebar-darwin-y-offset"), 10);- currentWindow.setWindowButtonPosition({ x: xOffset, y: yOffset });+ if (window.glob.platform === "darwin") {+ const xOffset = parseInt(style.getPropertyValue("--native-titlebar-darwin-x-offset"), 10);+ const yOffset = parseInt(style.getPropertyValue("--native-titlebar-darwin-y-offset"), 10);+ currentWindow.setWindowButtonPosition({ x: xOffset, y: yOffset });+ }}// Update the native title bar buttons.diff --git a/src/public/app/layouts/desktop_layout.js b/src/public/app/layouts/desktop_layout.jsindex fff7b0fbc6..b9d20feae1 100644--- a/src/public/app/layouts/desktop_layout.js+++ b/src/public/app/layouts/desktop_layout.js@@ -96,7 +96,7 @@ export default class DesktopLayout {const launcherPaneIsHorizontal = (options.get("layoutOrientation") === "horizontal");const launcherPane = this.#buildLauncherPane(launcherPaneIsHorizontal);const isMac = (window.glob.platform === "darwin");- const isWindows = (window.glob.platform === "windows");+ const isWindows = (window.glob.platform === "win32");const hasNativeTitleBar = (window.glob.hasNativeTitleBar);const fullWidthTabBar = (launcherPaneIsHorizontal && !isMac);const customTitleBarButtons = (hasNativeTitleBar && !isMac && !isWindows);