forked from akanyan/STARTLINER
feat: rudimentary config
This commit is contained in:
@ -134,3 +134,19 @@ pub async fn init_profile(
|
||||
|
||||
Ok(new_profile)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn set_cfg(
|
||||
state: State<'_, Mutex<AppData>>,
|
||||
key: String,
|
||||
value: String
|
||||
) -> Result<(), ()> {
|
||||
log::debug!("invoke: sync_cfg({}, {})", key, value);
|
||||
|
||||
let mut appd = state.lock().await;
|
||||
if let Some(p) = &mut appd.profile {
|
||||
p.cfg.insert(key, value);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user