chore: refactored lib.rs to move commands into separate folder

This commit is contained in:
2026-01-15 16:17:06 +08:00
parent 7ae501aaf0
commit 86d964943e
11 changed files with 352 additions and 315 deletions

View File

@@ -0,0 +1,31 @@
use crate::{
services::client_config_manager::{
load_app_config, open_config_manager_window, save_app_config, AppConfig,
},
state::FDOLL,
lock_w,
};
#[tauri::command]
pub fn get_client_config() -> AppConfig {
let mut guard = lock_w!(FDOLL);
guard.app_config = load_app_config();
guard.app_config.clone()
}
#[tauri::command]
pub fn save_client_config(config: AppConfig) -> Result<(), String> {
match save_app_config(config) {
Ok(saved) => {
let mut guard = lock_w!(FDOLL);
guard.app_config = saved;
Ok(())
}
Err(e) => Err(e.to_string()),
}
}
#[tauri::command]
pub async fn open_client_config_manager() -> Result<(), String> {
open_config_manager_window().map_err(|e| e.to_string())
}