fix: duplicate checked tray menu when profile name are same (#2660)

This commit is contained in:
Tunglies
2025-02-08 09:36:04 +08:00
committed by GitHub
parent bb0b6c3f77
commit 37e5c22a5a
4 changed files with 39 additions and 67 deletions

View File

@@ -105,9 +105,9 @@ pub fn toggle_system_proxy() {
}
// 切换代理文件
pub fn toggle_proxy_profile(profile_name: String) {
pub fn toggle_proxy_profile(profile_index: String) {
tauri::async_runtime::spawn(async move {
match cmds::patch_profiles_config_by_profile_name(profile_name).await {
match cmds::patch_profiles_config_by_profile_index(profile_index).await {
Ok(_) => {
let _ = tray::Tray::global().update_menu();
handle::Handle::refresh_verge();