Skip to content

Commit

Permalink
Merge branch 'fix/keystone' into tmp/20241108
Browse files Browse the repository at this point in the history
  • Loading branch information
heisenberg-2077 committed Nov 11, 2024
2 parents a2cf0cb + 754c7b7 commit fc3ccb1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
10 changes: 10 additions & 0 deletions src/ui/utils/sendTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,16 @@ export const sendTransaction = async ({
}
};

wallet.reportStats('signTransaction', {
type: currentAccount.brandName,
category: KEYRING_CATEGORY_MAP[currentAccount.type],
chainId: chain.serverId,
createdBy: ga ? 'rabby' : 'dapp',
source: ga?.source || '',
trigger: ga?.trigger || '',
networkType: chain?.isTestnet ? 'Custom Network' : 'Integrated Network',
});

// submit tx
let hash = '';
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const BalanceChangeWrapper: React.FC<Props> = ({
balanceChange.receive_nft_list.length +
balanceChange.receive_token_list.length +
balanceChange.send_nft_list.length +
balanceChange.send_nft_list.length <=
balanceChange.send_token_list.length <=
0
) {
return true;
Expand Down
20 changes: 13 additions & 7 deletions src/ui/views/HDManager/QRCodeManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,25 @@ export const QRCodeManager: React.FC<Props> = ({ brand }) => {
try {
setLoading(true);

if (type !== setting.type) {
if (setting.type && type !== setting.type) {
/**
* This code is written to be consistent with the behavior of importing wallets via QR Code.
*/
await removeAddressAndForgetDevice(false);
}

await wallet.requestKeyring(
KEYSTONE_TYPE,
'getAddressesViaUSB',
keyringId,
type
);
try {
await wallet.requestKeyring(
KEYSTONE_TYPE,
'getAddressesViaUSB',
keyringId,
type
);
} catch (e) {
// ignore
console.error(e);
}

await getCurrentAccounts();
setLoading(false);
} catch (error) {
Expand Down

0 comments on commit fc3ccb1

Please sign in to comment.