fix: Re-update the user and app status when recieve_handshake is called (#54)

Also enabled assetProtocol for better caching in general

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2025-06-06 12:09:44 +10:00
committed by GitHub
parent 86bce1c68d
commit 0ce55e12c5
5 changed files with 30 additions and 6 deletions

View File

@ -1,11 +1,11 @@
use std::{collections::HashMap, env};
use std::{collections::HashMap, env, sync::Mutex};
use chrono::Utc;
use droplet_rs::ssl::sign_nonce;
use gethostname::gethostname;
use log::{debug, error, warn};
use serde::{Deserialize, Serialize};
use tauri::{AppHandle, Emitter};
use tauri::{AppHandle, Emitter, Manager};
use url::Url;
use crate::{
@ -14,7 +14,7 @@ use crate::{
models::data::DatabaseAuth,
},
error::{drop_server_error::DropServerError, remote_access_error::RemoteAccessError},
AppStatus, User,
AppState, AppStatus, User,
};
use super::{
@ -157,6 +157,16 @@ pub fn recieve_handshake(app: AppHandle, path: String) {
return;
}
let app_state = app.state::<Mutex<AppState>>();
let mut state_lock = app_state.lock().unwrap();
let (app_status, user) = setup();
state_lock.status = app_status;
state_lock.user = user;
drop(state_lock);
app.emit("auth/finished", ()).unwrap();
}