fix: hide imtoken on desktop wallet login
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 30s

This commit is contained in:
TerryM
2026-06-04 15:29:22 +08:00
parent 53dc35e7dc
commit fd19ed438e

View File

@@ -53,7 +53,7 @@ export function WalletLoginModal() {
const { t } = useI18n();
const { closeLoginModal, completeLogin, loginModalOpen } = useWallet();
const [selected, setSelected] = useState<WalletKind | null>(null);
const [mobileDevice, setMobileDevice] = useState(false);
const [mobileDevice, setMobileDevice] = useState(() => isMobileDevice());
const [state, setState] = useState<LoginState>("idle");
const [error, setError] = useState("");
const [pendingLogin, setPendingLogin] = useState<PendingLogin | null>(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() {
</div>
<div className="mt-5 grid gap-2">
{wallets.map((kind) => {
{visibleWallets.map((kind) => {
const active = selected === kind;
const connecting = active && state === "connecting";
return (