save settings to db
This commit is contained in:
1 parent
12d9d733a5
commit
4aab08e6f0
4 files changed
+42
-14
No files matched your search
@@ -70,7 +70,8 @@ pub fn get_config(app_state: State<'_, AppState>) -> AppConfig {
|
||||
|
||||
|
||||
#[tauri::command]
|
||||
pub fn save_config(config: AppConfig, app_state: State<'_, AppState>) {
|
||||
let mut prev_config = app_state.config.write().unwrap();
|
||||
*prev_config = config;
|
||||
pub async fn save_config(config: AppConfig, app_state: State<'_, AppState>) -> Result<(), String> {
|
||||
app_state.update_config(config)
|
||||
.await
|
||||
.map_err(|e| format!("Error saving config to database: {e}"))
|
||||
}
|
||||
Reference in new issue
Block a user