From c39e8be29a37f32c5780b7b93e89a23d242fc0a2 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 9 Dec 2024 21:57:54 +0200 Subject: [PATCH] feat(server): set up option to toggle background effects --- src/routes/api/options.ts | 1 + src/routes/index.ts | 2 +- src/services/options_init.ts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/api/options.ts b/src/routes/api/options.ts index 0e60bea27..214e265ef 100644 --- a/src/routes/api/options.ts +++ b/src/routes/api/options.ts @@ -68,6 +68,7 @@ const ALLOWED_OPTIONS = new Set([ 'firstDayOfWeek', 'textNoteEditorType', 'layoutOrientation', + 'backgroundEffects', 'allowedHtmlTags' // Allow configuring HTML import tags ]); diff --git a/src/routes/index.ts b/src/routes/index.ts index 8dda180f6..c5c29797c 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -37,7 +37,7 @@ function index(req: Request, res: Response) { platform: process.platform, isElectron, hasNativeTitleBar: (isElectron && options.nativeTitleBarVisible === "true"), - hasBackgroundEffects: (isElectron && true), + hasBackgroundEffects: (isElectron && options.backgroundEffects === "true"), mainFontSize: parseInt(options.mainFontSize), treeFontSize: parseInt(options.treeFontSize), detailFontSize: parseInt(options.detailFontSize), diff --git a/src/services/options_init.ts b/src/services/options_init.ts index 60cce2176..a0d08a815 100644 --- a/src/services/options_init.ts +++ b/src/services/options_init.ts @@ -137,6 +137,7 @@ const defaultOptions: DefaultOption[] = [ // HTML import configuration { name: "layoutOrientation", value: "vertical", isSynced: false }, + { name: "backgroundEffects", value: "false", isSynced: false }, { name: "allowedHtmlTags", value: JSON.stringify([ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol', 'li', 'b', 'i', 'strong', 'em', 'strike', 's', 'del', 'abbr', 'code', 'hr', 'br', 'div',