mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-30 14:12:07 +02:00
Rework licensing flows to be more friendly
This commit is contained in:
@@ -120,6 +120,7 @@ pub struct Settings {
|
||||
pub theme_dark: String,
|
||||
pub theme_light: String,
|
||||
pub update_channel: String,
|
||||
pub hide_license_badge: bool,
|
||||
pub autoupdate: bool,
|
||||
}
|
||||
|
||||
@@ -169,6 +170,7 @@ impl UpsertModelInfo for Settings {
|
||||
(ThemeDark, self.theme_dark.as_str().into()),
|
||||
(ThemeLight, self.theme_light.as_str().into()),
|
||||
(UpdateChannel, self.update_channel.into()),
|
||||
(HideLicenseBadge, self.hide_license_badge.into()),
|
||||
(Autoupdate, self.autoupdate.into()),
|
||||
(ColoredMethods, self.colored_methods.into()),
|
||||
(Proxy, proxy.into()),
|
||||
@@ -192,6 +194,7 @@ impl UpsertModelInfo for Settings {
|
||||
SettingsIden::ThemeDark,
|
||||
SettingsIden::ThemeLight,
|
||||
SettingsIden::UpdateChannel,
|
||||
SettingsIden::HideLicenseBadge,
|
||||
SettingsIden::Autoupdate,
|
||||
SettingsIden::ColoredMethods,
|
||||
]
|
||||
@@ -223,6 +226,7 @@ impl UpsertModelInfo for Settings {
|
||||
hide_window_controls: row.get("hide_window_controls")?,
|
||||
update_channel: row.get("update_channel")?,
|
||||
autoupdate: row.get("autoupdate")?,
|
||||
hide_license_badge: row.get("hide_license_badge")?,
|
||||
colored_methods: row.get("colored_methods")?,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ impl<'a> DbContext<'a> {
|
||||
update_channel: "stable".to_string(),
|
||||
autoupdate: true,
|
||||
colored_methods: false,
|
||||
hide_license_badge: false,
|
||||
};
|
||||
self.upsert(&settings, &UpdateSource::Background).expect("Failed to upsert settings")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user