Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
Wallet,
WalletInfoRemote,
checkRequiredWalletFeatures,
WalletInfo
WalletInfo,
isQaModeEnabled
} from '@tonconnect/sdk';
import {
Component,
Expand Down Expand Up @@ -150,6 +151,12 @@ export const WalletsModal: Component = () => {
const wallet = walletsList()?.find(w => w.appName.toLowerCase() === errorAppName);

if (!wallet) {
if (isQaModeEnabled()) {
console.warn(
'[QA Mode] Wallet not found in error handler, but continuing due to QA mode'
);
return;
}
throw new TonConnectError('Wallet not found');
}

Expand Down
7 changes: 6 additions & 1 deletion packages/ui/src/managers/single-wallet-modal-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
isWalletInfoRemote,
ITonConnect,
WalletInfoCurrentlyEmbedded,
WalletInfoRemote
WalletInfoRemote,
isQaModeEnabled
} from '@tonconnect/sdk';
import { appState } from 'src/app/state/app.state';
import { widgetController } from 'src/app/widget-controller';
Expand Down Expand Up @@ -113,6 +114,10 @@ export class SingleWalletModalManager implements SingleWalletModal {
}

const error = `Trying to open modal window with unknown wallet "${wallet}".`;
if (isQaModeEnabled()) {
console.warn(`[QA Mode] ${error} But continuing due to QA mode`);
return;
}
this.tracker.trackConnectionError(error);
throw new TonConnectUIError(error);
}
Expand Down
9 changes: 8 additions & 1 deletion packages/ui/src/ton-connect-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import {
Wallet,
WalletInfo,
WalletNotSupportFeatureError,
SessionCrypto
SessionCrypto,
isQaModeEnabled
} from '@tonconnect/sdk';
import { widgetController } from 'src/app/widget-controller';
import { TonConnectUIError } from 'src/errors/ton-connect-ui.error';
Expand Down Expand Up @@ -1050,6 +1051,12 @@ export class TonConnectUI {
const walletInfo = walletsList.find(item => eqWalletName(item, wallet.device.appName));

if (!walletInfo) {
if (isQaModeEnabled()) {
console.warn(
`[QA Mode] WalletInfo not found for '${wallet.device.appName}' wallet, but continuing due to QA mode`
);
return null;
}
throw new TonConnectUIError(
`Cannot find WalletInfo for the '${wallet.device.appName}' wallet`
);
Expand Down