aboutsummaryrefslogtreecommitdiff
path: root/src/config
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-18 20:06:43 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-18 20:06:43 +0300
commit9f4f1630893f74697a2097ef11bf5bf512a37850 (patch)
tree5648332c37526b2868db205b661f89ba6c125f0d /src/config
parentd74ba8ca9e49d9d94a4e59a0ee0bdbd1128af76e (diff)
feat: add background update check toggles
refs #677
Diffstat (limited to 'src/config')
-rw-r--r--src/config/model.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/config/model.rs b/src/config/model.rs
index 7b1e7bb7..d07a425f 100644
--- a/src/config/model.rs
+++ b/src/config/model.rs
@@ -30,14 +30,17 @@ impl UpdateChannelConfig {
#[derive(Debug, Clone, Copy, Deserialize)]
#[serde(default)]
pub struct UpdateConfig {
- #[serde(default = "default_update_channel")]
pub channel: UpdateChannelConfig,
+ pub version_check: bool,
+ pub manifest_check: bool,
}
impl Default for UpdateConfig {
fn default() -> Self {
Self {
channel: default_update_channel(),
+ version_check: true,
+ manifest_check: true,
}
}
}
@@ -728,17 +731,23 @@ mod tests {
use super::*;
#[test]
- fn update_channel_defaults_for_platform_and_parses() {
+ fn update_config_defaults_and_parses() {
let default_config = Config::default();
assert_eq!(default_config.update.channel, default_update_channel());
+ assert!(default_config.update.version_check);
+ assert!(default_config.update.manifest_check);
let toml = r#"
[update]
channel = "preview"
+version_check = false
+manifest_check = false
"#;
let config: Config = toml::from_str(toml).unwrap();
assert_eq!(config.update.channel, UpdateChannelConfig::Preview);
assert_eq!(config.update.channel.as_str(), "preview");
+ assert!(!config.update.version_check);
+ assert!(!config.update.manifest_check);
}
#[test]