fix: resolve P3 audit findings

This commit is contained in:
NimBold
2026-06-15 14:24:34 +03:30
parent 789a8161b2
commit 1b04860c94
9 changed files with 27 additions and 134 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
use rusqlite::{Connection, Result, params};
use tokio::sync::Mutex;
use std::path::PathBuf;
use tauri::Manager;
pub struct DbState {
@@ -8,7 +8,7 @@ pub struct DbState {
}
pub fn init_db(app_handle: &tauri::AppHandle) -> Result<Connection> {
let app_dir = app_handle.path().app_data_dir().unwrap_or_else(|_| PathBuf::from("."));
let app_dir = app_handle.path().app_data_dir().expect("Cannot get app data dir");
if !app_dir.exists() {
let _ = std::fs::create_dir_all(&app_dir);
}