Skip to content

Commit

Permalink
fix(mobile): Regress fixes pt. 2 (#688)
Browse files Browse the repository at this point in the history
* fix(mobile): Add missing import

* fix(mobile): Enable encryption by default

* fix(mobile): Check insufficient funds
  • Loading branch information
voloshinskii authored Jan 25, 2024
1 parent c449c94 commit 3535441
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,20 +271,24 @@ export const openSignRawModal = async (
boc,
});

if (!isBattery) {
const totalAmount = calculateMessageTransferAmount(params.messages);
const checkResult = await checkIsInsufficient(totalAmount);
if (checkResult.insufficient) {
Toast.hide();
onDismiss?.();
return openInsufficientFundsModal({
totalAmount,
balance: checkResult.balance,
});
}
}

Toast.hide();
} catch (err) {
console.log(err);
debugLog('[SignRaw]: estimateTx error', JSON.stringify(err));

// in case of error we should check current TON balance and show "insufficient funds" modal
const totalAmount = calculateMessageTransferAmount(params.messages);
const checkResult = await checkIsInsufficient(totalAmount);
if (checkResult.insufficient) {
Toast.hide();
onDismiss?.();
return openInsufficientFundsModal({ totalAmount, balance: checkResult.balance });
}

const tonapiError = err?.response?.data?.error;
const errorMessage = tonapiError ?? `no response; status code: ${err.status};`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const AddressStepComponent: FC<AddressStepProps> = (props) => {
setRecipient,
changeBlockchain,
active,
enableEncryption = false,
enableEncryption = true,
setRecipientAccountInfo,
setAmount,
setComment,
Expand Down
1 change: 1 addition & 0 deletions packages/uikit/src/components/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
useMemo,
useRef,
} from 'react';
import { t } from '@tonkeeper/shared/i18n';

type FocusEvent = NativeSyntheticEvent<TextInputFocusEventData>;

Expand Down

0 comments on commit 3535441

Please sign in to comment.