mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 19:04:23 +08:00
chore: commit all remaining changes
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
use parking_lot::RwLock;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::sync::Arc;
|
||||
use tauri::State;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use chrono::{Datelike, Duration, TimeZone, Timelike, Utc};
|
||||
use chrono::{Datelike, Duration, Timelike, Utc};
|
||||
use parking_lot::RwLock;
|
||||
use sea_orm::{
|
||||
ActiveModelTrait, ColumnTrait, EntityTrait, QueryFilter, QueryOrder, QuerySelect, Set,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use parking_lot::RwLock;
|
||||
use sea_orm::{ActiveModelTrait, ColumnTrait, EntityTrait, QueryOrder, Set};
|
||||
use sea_orm::{ActiveModelTrait, EntityTrait, QueryOrder, Set};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::sync::Arc;
|
||||
use tauri::State;
|
||||
|
||||
@@ -4,8 +4,6 @@ use tauri::{AppHandle, Manager};
|
||||
|
||||
use crate::state::AppState;
|
||||
|
||||
use super::response::IpcResponse;
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn window_minimize(
|
||||
app: AppHandle,
|
||||
|
||||
@@ -29,7 +29,7 @@ pub fn setup_app(app: &mut App) -> Result<(), Box<dyn std::error::Error>> {
|
||||
}
|
||||
|
||||
fn setup_database(app: &mut App) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let handle = app.handle();
|
||||
let handle = app.handle().clone();
|
||||
let db_path = if cfg!(debug_assertions) {
|
||||
std::path::PathBuf::from("data.sql")
|
||||
} else {
|
||||
@@ -52,7 +52,7 @@ fn setup_database(app: &mut App) -> Result<(), Box<dyn std::error::Error>> {
|
||||
match create_sqlite_connection(&db_path_str).await {
|
||||
Ok(conn) => {
|
||||
let state = handle.state::<crate::state::SafeAppState>();
|
||||
let mut state_guard = state.write();
|
||||
let state_guard = state.write();
|
||||
let mut db_guard = state_guard.db.write();
|
||||
*db_guard = Some(conn);
|
||||
eprintln!("Database connected to: {}", db_path_str);
|
||||
|
||||
Reference in New Issue
Block a user