This commit is contained in:
2026-06-17 02:02:59 +08:00
parent 4d319c8138
commit ae6da23f6c

View File

@@ -97,14 +97,10 @@ function groupBoundWallets(wallets: WalletItem[]) {
})); }));
} }
function getBindKeyForWalletType(walletType: string): string | null { function parseWalletId(walletId: string): { walletType: string; phone: string } | null {
switch (walletType) { const i = walletId.lastIndexOf('_');
case 'paytm': return 'paytm_personal_token'; if (i <= 0) return null;
case 'phonepe': return 'phonepe_personal_token'; return { walletType: walletId.slice(0, i), phone: walletId.slice(i + 1) };
case 'mobikwik': return 'mobikwik_personal_token';
case 'freecharge': return 'freecharge_personal_token';
default: return null;
}
} }
function getBindKeyForWallet(item: WalletItem): string | null { function getBindKeyForWallet(item: WalletItem): string | null {
@@ -276,9 +272,12 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
this.handleRebind(item); this.handleRebind(item);
return; return;
} }
if (walletType) { const parsed = walletId ? parseWalletId(walletId) : null;
const key = getBindKeyForWalletType(walletType); const wt = walletType || parsed?.walletType;
if (key) this.openWalletBind(key, phone); const mobile = phone || parsed?.phone;
if (wt) {
const key = getBindKeyForWallet({ id: walletId ?? '', walletType: wt, otpMode: false });
if (key) this.openWalletBind(key, mobile);
} }
}; };