Skip to content

Commit

Permalink
Merge pull request #399 from pendulum-chain/rollback-no-error-display
Browse files Browse the repository at this point in the history
Do not show errors if wallet is not connected.
  • Loading branch information
gianfra-t authored Jan 23, 2025
2 parents 3cd0682 + 8622107 commit 3b301a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const SwapPage = () => {
const feeComparisonRef = useRef<FeeComparisonRef>(null);
const pendulumNode = usePendulumNode();
const [api, setApi] = useState<ApiPromise | null>(null);
const { address } = useVortexAccount();
const { isDisconnected, address } = useVortexAccount();
const [initializeFailedMessage, setInitializeFailedMessage] = useState<string | null>(null);
const [apiInitializeFailed, setApiInitializeFailed] = useState(false);
const [_, setIsReady] = useState(false);
Expand Down Expand Up @@ -253,6 +253,8 @@ export const SwapPage = () => {
);

function getCurrentErrorMessage() {
if (isDisconnected) return;

if (typeof userInputTokenBalance === 'string') {
if (Big(userInputTokenBalance).lt(fromAmount ?? 0) && walletAccount) {
trackEvent({ event: 'form_error', error_message: 'insufficient_balance' });
Expand Down

0 comments on commit 3b301a6

Please sign in to comment.