mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-12-04 13:10:11 +08:00
refactor(profile): extract profile models and index rules
Move profile models and index rules into the crate, preserving serialization and returning a typed missing-profile error.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
config::{Config, IClashTemp, IProfiles, IVerge},
|
||||
config::{Config, IClashTemp, IVerge, profiles::load_profiles},
|
||||
core::{CoreManager, auto_backup, backup, proxy_control, proxy_control::SystemProxyStateUnknown},
|
||||
process::AsyncHandler,
|
||||
utils::{
|
||||
@@ -46,7 +46,7 @@ async fn finalize_restored_verge_config(
|
||||
});
|
||||
clash_draft.apply();
|
||||
|
||||
let restored_profiles = IProfiles::new().await;
|
||||
let restored_profiles = load_profiles().await;
|
||||
let profiles_draft = Config::profiles().await;
|
||||
profiles_draft.edit_draft(|d| {
|
||||
*d = restored_profiles;
|
||||
|
||||
Reference in New Issue
Block a user