@@ -1024,6 +1024,10 @@ impl Config {
|
|||||||
|
|
||||||
pub fn set_option(k: String, v: String) {
|
pub fn set_option(k: String, v: String) {
|
||||||
if !is_option_can_save(&OVERWRITE_SETTINGS, &k, &DEFAULT_SETTINGS, &v) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
let mut config = CONFIG2.write().unwrap();
|
let mut config = CONFIG2.write().unwrap();
|
||||||
@@ -1800,6 +1804,10 @@ impl LocalConfig {
|
|||||||
|
|
||||||
pub fn set_option(k: String, v: String) {
|
pub fn set_option(k: String, v: String) {
|
||||||
if !is_option_can_save(&OVERWRITE_LOCAL_SETTINGS, &k, &DEFAULT_LOCAL_SETTINGS, &v) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
let mut config = LOCAL_CONFIG.write().unwrap();
|
let mut config = LOCAL_CONFIG.write().unwrap();
|
||||||
@@ -1960,6 +1968,9 @@ impl UserDefaultConfig {
|
|||||||
&DEFAULT_DISPLAY_SETTINGS,
|
&DEFAULT_DISPLAY_SETTINGS,
|
||||||
&value,
|
&value,
|
||||||
) {
|
) {
|
||||||
|
if self.options.remove(&key).is_some() {
|
||||||
|
self.store();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if value.is_empty() {
|
if value.is_empty() {
|
||||||
|
|||||||
Reference in New Issue
Block a user