Skip to content

Commit

Permalink
Add nested key for feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Hacksore committed Jul 28, 2024
1 parent 2c84bac commit 5a67b0d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/desktop/src-tauri/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand All @@ -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");
Expand Down

0 comments on commit 5a67b0d

Please sign in to comment.