fix: restore mobile wallet login feedback
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 37s
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 37s
This commit is contained in:
@@ -137,6 +137,11 @@ export function getInjectedEthereum(): EthereumProvider | null {
|
||||
return maybeWindow.ethereum ?? null;
|
||||
}
|
||||
|
||||
export function isTokenPocketBrowser(): boolean {
|
||||
if (typeof navigator === "undefined") return false;
|
||||
return /tokenpocket|tpwallet/i.test(navigator.userAgent || "");
|
||||
}
|
||||
|
||||
export function isImTokenBrowser(): boolean {
|
||||
if (typeof navigator === "undefined") return false;
|
||||
return /imtoken/i.test(navigator.userAgent || "");
|
||||
@@ -156,6 +161,10 @@ export function getInjectedWallet(kind?: WalletKind): EthereumProvider | null {
|
||||
});
|
||||
if (match) return match;
|
||||
|
||||
if (kind === "tokenPocket" && isTokenPocketBrowser()) {
|
||||
return providers[0] ?? ethereum;
|
||||
}
|
||||
|
||||
if (kind === "imToken" && isImTokenBrowser()) return providers[0] ?? ethereum;
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user