@@ -47,6 +47,7 @@ interface MobileUniversalModalProps {
47
47
export const MobileUniversalModal : Component < MobileUniversalModalProps > = props => {
48
48
const [ showQR , setShowQR ] = createSignal ( false ) ;
49
49
const [ firstClick , setFirstClick ] = createSignal ( true ) ;
50
+ const [ universalLink , setUniversalLink ] = createSignal < string | null > ( null ) ;
50
51
const connector = appState . connector ;
51
52
const walletsList = ( ) : WalletInfo [ ] =>
52
53
props . walletsList . filter ( w => supportsMobile ( w ) && w . appName !== AT_WALLET_APP_NAME ) ;
@@ -56,9 +57,12 @@ export const MobileUniversalModal: Component<MobileUniversalModalProps> = props
56
57
equals : bridgesIsEqual
57
58
} ) ;
58
59
59
- const getUniversalLink = createMemo ( ( ) : string =>
60
- connector . connect ( walletsBridges ( ) , props . additionalRequest )
61
- ) ;
60
+ const getUniversalLink = ( ) : string => {
61
+ if ( ! universalLink ( ) ) {
62
+ setUniversalLink ( connector . connect ( walletsBridges ( ) , props . additionalRequest ) ) ;
63
+ }
64
+ return universalLink ( ) ! ;
65
+ } ;
62
66
63
67
setLastSelectedWalletInfo ( { openMethod : 'universal-link' } ) ;
64
68
@@ -96,6 +100,8 @@ export const MobileUniversalModal: Component<MobileUniversalModalProps> = props
96
100
} ;
97
101
98
102
const onSelectTelegram = ( ) : void => {
103
+ setUniversalLink ( null ) ;
104
+
99
105
const atWallet = props . walletsList . find ( wallet => wallet . appName === AT_WALLET_APP_NAME ) ;
100
106
if ( ! atWallet || ! isWalletInfoRemote ( atWallet ) ) {
101
107
throw new TonConnectUIError ( '@wallet bot not found in the wallets list' ) ;
0 commit comments