refactor: frontend (#7097)

* refactor: remove unused window show/hide event listeners

* refactor: deduplicate profile-changed event handling

* refactor: remove unused setupCloseListener from use-listen

* refactor: remove unused removeAllListeners from use-listen

* fix(backend): dedupe profile changed notification on import

* fix: avoid duplicate timer update completed event

* refactor(frontend): simplify proxy switch fallback path
This commit is contained in:
Tunglies
2026-05-23 12:52:52 +08:00
committed by GitHub
parent d3bb018ab7
commit c18c23963d
8 changed files with 9 additions and 138 deletions
-8
View File
@@ -94,14 +94,6 @@ pub async fn import_profile(url: std::string::String, option: Option<PrfOption>)
handle::Handle::notify_profile_changed(uid);
}
// 异步保存配置文件并发送全局通知
if let Some(uid) = &item.uid {
// 延迟发送,确保文件已完全写入
tokio::time::sleep(Duration::from_millis(100)).await;
logging!(info, Type::Cmd, "[导入订阅] 发送配置变更通知: {}", uid);
handle::Handle::notify_profile_changed(uid);
}
logging!(info, Type::Cmd, "[导入订阅] 导入完成: {}", help::mask_url(&url));
Ok(())
}