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
client: Hide tray settings on web
Elian Doran1172908e419b
diff --git a/integration-tests/settings.spec.ts b/integration-tests/settings.spec.tsindex aba6b7d06a..6a9060c1ee 100644--- a/integration-tests/settings.spec.ts+++ b/integration-tests/settings.spec.ts@@ -6,3 +6,8 @@ test("Native Title Bar not displayed on web", async ({ page }) => {await expect(page.getByRole('heading', { name: 'Native Title Bar (requires' })).toBeHidden();});+test("Tray settings not displayed on web", async ({ page }) => {+ await page.goto('http://localhost:8082/#root/_hidden/_options/_optionsOther');+ await expect(page.getByRole('heading', { name: 'Note Erasure Timeout' })).toBeVisible();+ await expect(page.getByRole('heading', { name: 'Tray' })).toBeHidden();+});\ No newline at end of filediff --git a/src/public/app/widgets/type_widgets/options/other/tray.js b/src/public/app/widgets/type_widgets/options/other/tray.jsindex c20469ce7d..ac7f91eb96 100644--- a/src/public/app/widgets/type_widgets/options/other/tray.js+++ b/src/public/app/widgets/type_widgets/options/other/tray.js@@ -1,5 +1,6 @@import OptionsWidget from "../options_widget.js";import { t } from "../../../../services/i18n.js";+import utils from "../../../../services/utils.js";const TPL = `<div class="options-section">@@ -19,6 +20,10 @@ export default class TrayOptions extends OptionsWidget {this.updateOption('disableTray', !this.$trayEnabled.is(":checked") ? "true" : "false"));}+ isEnabled() {+ return utils.isElectron();+ }+async optionsLoaded(options) {this.$trayEnabled.prop("checked", options.disableTray !== 'true');}