mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-23 12:12:09 +08:00
* fix(config): prevent cleanup_orphaned_files from deleting active profiles When IProfiles::new() fails to parse profiles.yaml (e.g., corrupt file), it returns Self::default() with items: None. The subsequent cleanup_orphaned_files() call then sees no active files and deletes all profile files in the profiles/ directory except the two hardcoded protected files (Merge.yaml and Script.js). Guard cleanup_orphaned_files() against this by checking if items is None or empty before proceeding. When items is unavailable, skip the cleanup and log a warning instead of blindly deleting user data. Fixes #7577 * fix(home): manual update check not working when auto_check_update disabled When auto_check_update is false, useUpdate() sets enabled=false for the SWR query, which sets the SWR key to null. Calling swr.mutate() on a null key does not execute the queryFn, returning undefined instead. This caused the home page's "last check time" click to instantly show "already up to date" without actually checking for updates. Fix: use revalidateQuery() for the manual checkUpdate function, which uses the global SWR mutate with the actual query key, bypassing the enabled: false state and always triggering a real network request. Fixes #7584 * fix: preserve manual update and profile data --------- Co-authored-by: Evan Gong <evan@users.noreply.github.com> Co-authored-by: wonfen <96291150+wonfen@users.noreply.github.com> Co-authored-by: wonfen <eiwonfen@gmail.com>