From 6dd16e340078ddd33cffa132b24a778cf11f1b34 Mon Sep 17 00:00:00 2001 From: Sean Boult <996134+Hacksore@users.noreply.github.com> Date: Sun, 28 Jul 2024 09:34:48 -0500 Subject: [PATCH] Add nested key for feature flags --- apps/desktop/src-tauri/src/config.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src-tauri/src/config.rs b/apps/desktop/src-tauri/src/config.rs index 4841d686..2702884d 100644 --- a/apps/desktop/src-tauri/src/config.rs +++ b/apps/desktop/src-tauri/src/config.rs @@ -12,6 +12,12 @@ pub enum WindowLayout { Center, } +#[derive(Deserialize, Serialize, Debug)] +#[serde(rename_all = "camelCase")] +pub struct FeatureFlags { + hide_overlay_on_mouseover: bool, +} + #[derive(Deserialize, Serialize, Debug)] #[serde(rename_all = "camelCase")] pub struct Config { @@ -20,6 +26,7 @@ pub struct Config { pub telemetry: bool, pub join_history_notifications: bool, pub show_only_talking_users: bool, + pub feature_flags: FeatureFlags, } // create a helper function to seed the config with values @@ -38,8 +45,9 @@ pub fn create_config(app: &AppHandle) { store.insert("pin".to_string(), json!(false)); store.insert("placement".to_string(), json!(WindowLayout::Center)); store.insert("telemetry".to_string(), json!(true)); - store.insert("join_history_notifications".to_string(), json!(true)); - store.insert("show_only_talking_users".to_string(), json!(true)); + store.insert("joinHistoryNotifications".to_string(), json!(true)); + store.insert("showOnlyTalkingUsers".to_string(), json!(true)); + store.insert("featureFlags".to_string(), json!({})); store.save(); debug!("Config file created successfully");