remove can't save option

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2025-09-18 14:15:18 +08:00
parent 9e7696c7d4
commit 0d900a20ea

View File

@@ -1024,6 +1024,10 @@ impl Config {
pub fn set_option(k: String, v: String) {
if !is_option_can_save(&OVERWRITE_SETTINGS, &k, &DEFAULT_SETTINGS, &v) {
let mut config = CONFIG2.write().unwrap();
if config.options.remove(&k).is_some() {
config.store();
}
return;
}
let mut config = CONFIG2.write().unwrap();
@@ -1800,6 +1804,10 @@ impl LocalConfig {
pub fn set_option(k: String, v: String) {
if !is_option_can_save(&OVERWRITE_LOCAL_SETTINGS, &k, &DEFAULT_LOCAL_SETTINGS, &v) {
let mut config = LOCAL_CONFIG.write().unwrap();
if config.options.remove(&k).is_some() {
config.store();
}
return;
}
let mut config = LOCAL_CONFIG.write().unwrap();
@@ -1960,6 +1968,9 @@ impl UserDefaultConfig {
&DEFAULT_DISPLAY_SETTINGS,
&value,
) {
if self.options.remove(&key).is_some() {
self.store();
}
return;
}
if value.is_empty() {