refactor: improve notification handling and avoid backend loop with empty messages

This commit is contained in:
Tunglies
2025-11-07 00:47:14 +08:00
parent 333440535b
commit 19b3899a1b
4 changed files with 23 additions and 20 deletions

View File

@@ -11,7 +11,10 @@ export const handleNoticeMessage = (
) => {
const handlers: Record<string, () => void> = {
"import_sub_url::ok": () => {
navigate("/profile", { state: { current: msg } });
// 空 msg 传入,我们不希望导致 后端-前端-后端 死循环,这里只做提醒。
// 未来细分事件通知时,可以考虑传入订阅 ID 或其他标识符
// navigate("/profile", { state: { current: msg } });
navigate("/profile");
showNotice("success", t("Import Subscription Successful"));
},
"import_sub_url::error": () => {