From a0a99cd3cc1455197d9b8f5c8bdd593ba052f8aa Mon Sep 17 00:00:00 2001 From: Niccolo Borgioli Date: Sun, 25 Aug 2024 22:18:31 +0200 Subject: [PATCH] cleanup status variable --- packages/backend/src/config.rs | 8 ++++---- packages/backend/src/status/mod.rs | 2 +- packages/shared/src/api.ts | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/config.rs b/packages/backend/src/config.rs index e86e4da..1d86cd0 100644 --- a/packages/backend/src/config.rs +++ b/packages/backend/src/config.rs @@ -38,10 +38,6 @@ pub static ref ALLOW_FILES: bool = std::env::var("ALLOW_FILES") .unwrap_or("true".to_string()) .parse() .unwrap(); -pub static ref THEME_NEW_NOTE_NOTICE: bool = std::env::var("THEME_NEW_NOTE_NOTICE") - .unwrap_or("true".to_string()) - .parse() - .unwrap(); } // THEME @@ -62,4 +58,8 @@ lazy_static! { .unwrap_or("".to_string()) .parse() .unwrap(); + pub static ref THEME_NEW_NOTE_NOTICE: bool = std::env::var("THEME_NEW_NOTE_NOTICE") + .unwrap_or("true".to_string()) + .parse() + .unwrap(); } diff --git a/packages/backend/src/status/mod.rs b/packages/backend/src/status/mod.rs index f5e7e18..d02b092 100644 --- a/packages/backend/src/status/mod.rs +++ b/packages/backend/src/status/mod.rs @@ -13,12 +13,12 @@ pub struct Status { pub max_expiration: u32, pub allow_advanced: bool, pub allow_files: bool, - pub theme_new_note_notice: bool, // Theme pub theme_image: String, pub theme_text: String, pub theme_page_title: String, pub theme_favicon: String, + pub theme_new_note_notice: bool, } pub async fn get_status() -> (StatusCode, Json) { diff --git a/packages/shared/src/api.ts b/packages/shared/src/api.ts index bb89b69..e210f40 100644 --- a/packages/shared/src/api.ts +++ b/packages/shared/src/api.ts @@ -116,6 +116,7 @@ export type Status = { theme_text: string theme_favicon: string theme_page_title: string + theme_new_note_notice: boolean } export async function status() {