Skip to content

Commit

Permalink
fix(mobile): 4.5.0 qa fixes (#853)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorokin0andrey authored May 15, 2024
1 parent c301bc0 commit 3ac9a0f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ export const AccessConfirmation: FC = () => {
try {
const promise = getCurrentConfirmationVaultPromise();

const walletForUnlock = isUnlock ? tk.walletForUnlock : wallet;
const walletForUnlock =
isUnlock || wallet.isWatchOnly || wallet.isExternal ? tk.walletForUnlock : wallet;
const passcode = await vault.exportPasscodeWithBiometry();
const mnemonic = await vault.exportWithPasscode(
walletForUnlock.identifier,
Expand Down
16 changes: 1 addition & 15 deletions packages/mobile/src/modals/BurnVouchersModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useNavigation } from '@tonkeeper/router';
import {
Button,
Icon,
Expand Down Expand Up @@ -26,17 +25,6 @@ import { Ton } from '$libs/Ton';
import { BatterySupportedTransaction } from '$wallet/managers/BatteryManager';
import { Address, beginCell, toNano } from '@ton/core';
import { checkBurnDate, getNotcoinBurnAddress } from '$utils/notcoin';
import nacl from 'tweetnacl';

function getRandomUint64(): bigint {
const buffer = nacl.randomBytes(8);
let result = BigInt(0);
for (let i = 0; i < buffer.length; i++) {
result += BigInt(buffer[i]) << BigInt(8 * i);
}

return result;
}

interface BurnVouchersModalProps {
max?: boolean;
Expand All @@ -45,8 +33,6 @@ interface BurnVouchersModalProps {
export const BurnVouchersModal = memo<BurnVouchersModalProps>((props) => {
const { max = false } = props;

const nav = useNavigation();

const nfts = useNftsState((s) =>
Object.values(s.accountNfts).filter(
(nft) =>
Expand Down Expand Up @@ -97,7 +83,7 @@ export const BurnVouchersModal = memo<BurnVouchersModalProps>((props) => {
.storeCoins(toNano('0.05'))
.storeBit(false)
.storeUint(0x5fec6642, 32)
.storeUint(getRandomUint64(), 64)
.storeUint(nft.index, 64)
.endCell()
.toBoc()
.toString('base64'),
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/src/store/wallet/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ export function* walletGetUnlockedVault(action?: WalletGetUnlockedVaultAction) {
try {
const wallet = action?.payload?.walletIdentifier
? tk.wallets.get(action.payload.walletIdentifier)!
: tk.wallet;
: tk.walletForUnlock;

let withoutBiometryOnOpen = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,20 @@ export const WalletActionButtons = memo(() => {

const handlePressScanQR = React.useCallback(() => {
if (store.getState().wallet.wallet) {
openScanQR((address) => {
if (Address.isValid(address)) {
openScanQR((value) => {
if (Address.isValid(value)) {
setTimeout(() => {
openSend({ currency: CryptoCurrencies.Ton, address });
openSend({ currency: CryptoCurrencies.Ton, address: value });
}, 200);

return true;
}

const resolver = deeplinking.getResolver(address, {
if (value.startsWith('tonkeeper://signer/link')) {
return;
}

const resolver = deeplinking.getResolver(value, {
delay: 200,
origin: DeeplinkOrigin.QR_CODE,
});
Expand Down

0 comments on commit 3ac9a0f

Please sign in to comment.