save settings to db

This commit is contained in:
jfmonty2 committed 2023-04-26 15:49:08 -07:00
1 parent 12d9d733a5
commit 4aab08e6f0
4 files changed
+42 -14

No files matched your search

+4 -3
View File
@@ -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}"))
}