diff --git a/src-tauri/src/configuration/deserialized.rs b/src-tauri/src/configuration/deserialized.rs index 3202cfc..947060a 100644 --- a/src-tauri/src/configuration/deserialized.rs +++ b/src-tauri/src/configuration/deserialized.rs @@ -7,6 +7,8 @@ use crate::configuration::partial::PartialOption; use crate::common::utils::parse_theme; + + #[derive(Debug, Serialize, Clone)] #[serde(rename_all = "camelCase")] pub struct Option { @@ -28,18 +30,20 @@ pub struct Option { impl Default for Option { fn default() -> Self { + let uuid = uuid::Uuid::new_v4().to_string(); + Self { app_theme: String::default(), terminal_theme: TerminalTheme::default(), background: BackgroundType::default(), custom_titlebar: true, // TODO: Set false on linux - profiles: vec![default_profile()], + profiles: vec![default_profile(uuid.clone())], terminal: TerminalOption::default(), close_confirmation: true, background_transparency: RangedInt::default(), shortcuts: default_shortcuts(), macros: Vec::default(), - default_profile: default_profile(), + default_profile: default_profile(uuid), theme: String::default() } @@ -469,8 +473,8 @@ fn default_to_true() -> bool { true } -fn default_profile() -> Profile { - Profile { name: String::from("Default profile"), terminal_options: TerminalOption::default(), theme: TerminalTheme::default(), background_transparency: RangedInt::default(), uuid: uuid::Uuid::new_v4().to_string(), command: String::from("sh -c $SHELL") /* TODO: Set correct for each oses*/ } +fn default_profile(uuid: String) -> Profile { + Profile { name: String::from("Default profile"), terminal_options: TerminalOption::default(), theme: TerminalTheme::default(), background_transparency: RangedInt::default(), uuid, command: String::from("sh -c $SHELL") /* TODO: Set correct for each oses*/ } } fn default_shortcuts() -> Vec { diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index a0136d8..aedf3ac 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -13,7 +13,6 @@ use std::sync::{Arc, Mutex}; fn main() { let start = std::time::Instant::now(); - let logger = Arc::from(Logger {}); let config_file = std::fs::read_to_string(format!( @@ -22,9 +21,6 @@ fn main() { )); - - - let option = Arc::from(Mutex::from(if let Ok(config_file) = config_file { // TODO: Log error serde_json::from_str(&config_file).unwrap_or_default()