mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-14 08:41:21 +10:00
fix(settings): Broken command invoke logic in settings/downloads.vue
This commit is contained in:
@ -59,13 +59,11 @@ pub fn add_download_dir(new_dir: PathBuf) -> UserValue<(), Error> {
|
||||
|
||||
#[tauri::command]
|
||||
pub fn update_settings(new_settings: Value) {
|
||||
println!("{}", new_settings);
|
||||
let mut db_lock = DB.borrow_data_mut().unwrap();
|
||||
let mut current_settings = serde_json::to_value(db_lock.settings.clone()).unwrap();
|
||||
for (key, value) in new_settings.as_object().unwrap() {
|
||||
current_settings[key] = value.clone();
|
||||
}
|
||||
println!("New settings unset: {}", ¤t_settings);
|
||||
let new_settings: Settings = serde_json::from_value(current_settings).unwrap();
|
||||
db_lock.settings = new_settings;
|
||||
println!("New Settings: {:?}", db_lock.settings);
|
||||
|
||||
Reference in New Issue
Block a user