Skip to content

Commit

Permalink
fix(all): autoupdate setting
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Oct 6, 2023
1 parent 6e531f5 commit 1f321fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src-tauri/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub struct Config {
pub rpc_server: Option<bool>,
pub open_on_startup: Option<bool>,
pub startup_minimized: Option<bool>,
pub autoupdate: Option<bool>,
}

pub fn init() {
Expand Down Expand Up @@ -62,6 +63,7 @@ pub fn default_config() -> Config {
rpc_server: Option::from(false),
open_on_startup: Option::from(false),
startup_minimized: Option::from(false),
autoupdate: Option::from(false),
}
}

Expand Down Expand Up @@ -155,3 +157,9 @@ pub fn get_startup_minimize() -> bool {
serde_json::from_str(read_config_file().as_str()).unwrap_or_else(|_| default_config());
parsed.startup_minimized.unwrap_or(false)
}

pub fn _get_autoupdate() -> bool {
let parsed: Config =
serde_json::from_str(read_config_file().as_str()).unwrap_or_else(|_| default_config());
parsed.autoupdate.unwrap_or(false)
}

0 comments on commit 1f321fd

Please sign in to comment.