forked from akanyan/STARTLINER
feat: more options
This commit is contained in:
@ -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>>,
|
||||
|
Reference in New Issue
Block a user