避免钱包清理产生未处理拒绝

使用同时处理成功与失败的 Promise 回调清理活动请求,避免 finally 派生拒绝无人观察。
This commit is contained in:
2026-08-05 17:52:53 +08:00
parent bf25b85c7e
commit a701058780
@@ -133,14 +133,15 @@ export function createProfileWalletStore(
})();
activeRefresh = refresh;
activeAbortController = abortController;
void refresh.finally(() => {
const clearActiveRefresh = () => {
if (activeRefresh === refresh) {
activeRefresh = null;
}
if (activeAbortController === abortController) {
activeAbortController = null;
}
});
};
void refresh.then(clearActiveRefresh, clearActiveRefresh);
return refresh;
},
resetWalletBalance: () => {