mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
feat: implement CmdProxyState for managing proxy refresh state and add state management module
refactor: remove unnecessary macOS conditional compilation directive
This commit is contained in:
4
src-tauri/src/state/mod.rs
Normal file
4
src-tauri/src/state/mod.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
// Tauri Manager 会进行 Arc 管理,无需额外 Arc
|
||||
// https://tauri.app/develop/state-management/#do-you-need-arc
|
||||
|
||||
pub mod proxy;
|
||||
15
src-tauri/src/state/proxy.rs
Normal file
15
src-tauri/src/state/proxy.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
pub struct CmdProxyState {
|
||||
pub last_refresh_time: std::time::Instant,
|
||||
pub need_refresh: bool,
|
||||
pub providers_proxies: serde_json::Value,
|
||||
}
|
||||
|
||||
impl Default for CmdProxyState {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
last_refresh_time: std::time::Instant::now(),
|
||||
need_refresh: true,
|
||||
providers_proxies: serde_json::Value::Null,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user