Fixed bugs

This commit is contained in:
2026-08-19 14:13:53 -04:00
parent fb368bd98f
commit 2e439fce0e
5 changed files with 11 additions and 7 deletions
+1
View File
@@ -22,6 +22,7 @@ fn accounts_file_path(app: &AppHandle) -> Result<std::path::PathBuf, String> {
.path()
.app_data_dir()
.map_err(|e| format!("Failed to resolve app data dir: {e}"))?;
fs::create_dir_all(&dir).map_err(|e| format!("Failed to create app data dir: {e}"))?;
Ok(dir.join("accounts.json"))
}
+1 -2
View File
@@ -41,10 +41,9 @@ pub fn save_server_list(app: AppHandle, servers: ServerList) -> Result<(), Strin
#[tauri::command]
pub fn get_server_list(app: AppHandle) -> Result<ServerList, String> {
let path = servers_file_path(&app)?;
println!("{path:?}");
if !path.exists() {
fs::write(&path, "[]").map_err(|e| format!("Failed to write first server list: {e}"))?;
return Ok(ServerList::new());
}