feat(settings): add do not check for updates (#246)

Co-authored-by: Gregory Schier <gschier1990@gmail.com>
This commit is contained in:
Gabriel Oliveira
2025-08-08 17:25:55 -03:00
committed by GitHub
parent 5f99b7df05
commit f8b0510d08
6 changed files with 29 additions and 5 deletions

View File

@@ -120,6 +120,7 @@ pub struct Settings {
pub theme_dark: String,
pub theme_light: String,
pub update_channel: String,
pub autoupdate: bool,
}
impl UpsertModelInfo for Settings {
@@ -168,6 +169,7 @@ impl UpsertModelInfo for Settings {
(ThemeDark, self.theme_dark.as_str().into()),
(ThemeLight, self.theme_light.as_str().into()),
(UpdateChannel, self.update_channel.into()),
(Autoupdate, self.autoupdate.into()),
(ColoredMethods, self.colored_methods.into()),
(Proxy, proxy.into()),
])
@@ -190,6 +192,7 @@ impl UpsertModelInfo for Settings {
SettingsIden::ThemeDark,
SettingsIden::ThemeLight,
SettingsIden::UpdateChannel,
SettingsIden::Autoupdate,
SettingsIden::ColoredMethods,
]
}
@@ -219,6 +222,7 @@ impl UpsertModelInfo for Settings {
theme_light: row.get("theme_light")?,
hide_window_controls: row.get("hide_window_controls")?,
update_channel: row.get("update_channel")?,
autoupdate: row.get("autoupdate")?,
colored_methods: row.get("colored_methods")?,
})
}

View File

@@ -31,6 +31,7 @@ impl<'a> DbContext<'a> {
theme_dark: "yaak-dark".to_string(),
theme_light: "yaak-light".to_string(),
update_channel: "stable".to_string(),
autoupdate: true,
colored_methods: false,
};
self.upsert(&settings, &UpdateSource::Background).expect("Failed to upsert settings")