feat: more options

This commit is contained in:
2025-03-05 00:40:59 +01:00
parent daafe1856b
commit 39ba6a5891
14 changed files with 1260 additions and 163 deletions

View File

@ -133,6 +133,17 @@ pub async fn get_current_profile(state: State<'_, Mutex<AppData>>) -> Result<Opt
Ok(appd.profile.clone())
}
#[tauri::command]
pub async fn get_current_profile_dir(state: State<'_, Mutex<AppData>>) -> Result<PathBuf, &str> {
let appd = state.lock().await;
if let Some(p) = &appd.profile {
Ok(p.dir())
} else {
Err("No profile loaded")
}
}
#[tauri::command]
pub async fn save_current_profile(state: State<'_, Mutex<AppData>>) -> Result<(), ()> {
log::debug!("invoke: save_current_profile");
@ -167,20 +178,6 @@ pub async fn init_profile(
}
}
// #[tauri::command]
// pub async fn profile_dir(
// state: State<'_, Mutex<AppData>>
// ) -> Result<PathBuf, &str> {
// let appd = state.lock().await;
// if let Some(p) = &appd.profile {
// Ok(p.dir())
// } else {
// Err("No profile loaded")
// }
// }
// the tauri fs plugin doesn't fucking work
#[tauri::command]
pub async fn read_profile_data(
state: State<'_, Mutex<AppData>>,