diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-22 17:01:25 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-22 17:01:25 +0300 |
| commit | 4b482f37a1e233b9aca6bf99b12e8b4da3e5c05e (patch) | |
| tree | 69d1a56ad6335547eec9727691310cf96ebe9623 /src/app/config_io.rs | |
| parent | 5bd939fbfc92a8073d0eac11dfb02a31ea638b15 (diff) | |
feat: add terminal-delivered client notifications
Diffstat (limited to 'src/app/config_io.rs')
| -rw-r--r-- | src/app/config_io.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/app/config_io.rs b/src/app/config_io.rs index 21d4365b..5d4b2b13 100644 --- a/src/app/config_io.rs +++ b/src/app/config_io.rs @@ -25,6 +25,12 @@ impl App { } } + pub(super) fn mark_onboarding_complete(&mut self) { + self.update_config_file("onboarding setting", |content| { + crate::config::upsert_top_level_bool(content, "onboarding", false) + }); + } + pub(super) fn save_theme(&mut self, name: &str) { self.update_config_file("theme", |content| { crate::config::upsert_section_value(content, "theme", "name", &format!("\"{name}\"")) @@ -37,9 +43,16 @@ impl App { }); } - pub(super) fn save_toast(&mut self, enabled: bool) { + pub(super) fn save_toast_delivery(&mut self, delivery: crate::config::ToastDelivery) { + let value = match delivery { + crate::config::ToastDelivery::Off => "\"off\"", + crate::config::ToastDelivery::Herdr => "\"herdr\"", + crate::config::ToastDelivery::Terminal => "\"terminal\"", + }; self.update_config_file("toast setting", |content| { - crate::config::upsert_section_bool(content, "ui.toast", "enabled", enabled) + let content = + crate::config::upsert_section_value(content, "ui.toast", "delivery", value); + crate::config::remove_section_key(&content, "ui.toast", "enabled") }); } } |
