fix: reset TokenPocket request state on expired/failed poll

Clear tpRequest when a TokenPocket login expires or fails so the mobile UI
returns to the initial state instead of showing a stuck waiting spinner
alongside the error.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
TerryM
2026-06-02 04:30:27 +08:00
parent ed04e1fb7e
commit 8821058c0a

View File

@@ -97,6 +97,7 @@ export function WalletLoginModal() {
} }
if (result.status === "expired" || result.status === "failed") { if (result.status === "expired" || result.status === "failed") {
setState("idle"); setState("idle");
setTpRequest(null);
setError(result.error || t("walletTpExpired")); setError(result.error || t("walletTpExpired"));
} }
} catch (err) { } catch (err) {