refactor: activate selected proxies (#7285)

* feat(profiles): add automatic node activation after profile switch

* refactor(use-profiles): simplify patchCurrent logic by always mutating profiles

* refactor(use-profiles): remove unused activateSelected function and related imports

* refactor: rename worker handle to activate selected task

* fix: clippy

* refactor(config): replace log statements with structured logging

* refactor(config): fix incorrect retry logic in profile activation

* feat(profiles): update proxy cache when switching profiles

* docs: update changelog with bug fixes and logic improvements

* refactor(profiles): remove unused imports and redundant cache update
This commit is contained in:
oomeow
2026-07-01 12:47:03 +00:00
committed by GitHub
parent af0518d578
commit c2ddb5c111
5 changed files with 115 additions and 182 deletions
+2
View File
@@ -1,6 +1,7 @@
use super::CmdResult;
use super::StringifyErr as _;
use crate::cmd::validate::{ValidationNoticeTarget, handle_validation_notice};
use crate::config::profiles;
use crate::utils::window_manager::WindowManager;
use crate::{
config::{
@@ -212,6 +213,7 @@ async fn restore_previous_profile(prev_profile: &String) -> CmdResult<()> {
async fn handle_success(current_value: Option<&String>) -> CmdResult<ValidationOutcome> {
Config::profiles().await.apply();
profiles::activate_selected_nodes().await.stringify_err()?;
handle::Handle::refresh_clash();
if let Err(e) = Tray::global().update_tooltip().await {