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