From fd19ed438e3a76827f588a5eeaee51260aeaeb88 Mon Sep 17 00:00:00 2001 From: TerryM Date: Thu, 4 Jun 2026 15:29:22 +0800 Subject: [PATCH] fix: hide imtoken on desktop wallet login --- src/wallet/WalletLoginModal.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wallet/WalletLoginModal.tsx b/src/wallet/WalletLoginModal.tsx index db2a2a5..0ab69b9 100644 --- a/src/wallet/WalletLoginModal.tsx +++ b/src/wallet/WalletLoginModal.tsx @@ -53,7 +53,7 @@ export function WalletLoginModal() { const { t } = useI18n(); const { closeLoginModal, completeLogin, loginModalOpen } = useWallet(); const [selected, setSelected] = useState(null); - const [mobileDevice, setMobileDevice] = useState(false); + const [mobileDevice, setMobileDevice] = useState(() => isMobileDevice()); const [state, setState] = useState("idle"); const [error, setError] = useState(""); const [pendingLogin, setPendingLogin] = useState(null); @@ -74,6 +74,9 @@ export function WalletLoginModal() { t(key).replaceAll("{wallet}", walletName(kind)); const walletHint = () => mobileDevice ? t("walletChooseMobile") : t("walletDesktopHint"); + const visibleWallets = mobileDevice + ? wallets + : wallets.filter(supportsDesktopExtension); const busy = state !== "idle"; const close = () => { @@ -179,7 +182,7 @@ export function WalletLoginModal() {
- {wallets.map((kind) => { + {visibleWallets.map((kind) => { const active = selected === kind; const connecting = active && state === "connecting"; return (