Skip to content

Commit bfa20e0

Browse files
committed
Show small message on wallet connect scene if the client isn't connected
1 parent 69c2e95 commit bfa20e0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/scenes/WcConnectionsScene.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ import * as React from 'react'
55
import { ScrollView, TouchableOpacity, View } from 'react-native'
66
import FastImage from 'react-native-fast-image'
77
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
8+
import { sprintf } from 'sprintf-js'
89

910
import { showBackupForTransferModal } from '../../actions/BackupModalActions'
1011
import { SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants'
1112
import { useAsyncEffect } from '../../hooks/useAsyncEffect'
1213
import { useMount } from '../../hooks/useMount'
13-
import { useWalletConnect } from '../../hooks/useWalletConnect'
14+
import { useWalletConnect, walletConnectClient } from '../../hooks/useWalletConnect'
1415
import { lstrings } from '../../locales/strings'
1516
import { useSelector } from '../../types/reactRedux'
1617
import { EdgeSceneProps } from '../../types/routerTypes'
@@ -102,6 +103,11 @@ export const WcConnectionsScene = (props: Props) => {
102103
spinner={connecting}
103104
/>
104105
<EdgeText style={styles.listTitle}>{lstrings.wc_walletconnect_active_connections}</EdgeText>
106+
{walletConnectClient.client != null ? null : (
107+
<EdgeText style={{ ...styles.listTitle, color: theme.dangerText }}>
108+
{sprintf(lstrings.wc_dapp_disconnected, lstrings.wc_walletconnect_title)}
109+
</EdgeText>
110+
)}
105111
<View style={styles.list}>
106112
{connections.map((dAppConnection: WcConnectionInfo, index) => (
107113
<TouchableOpacity key={index} style={styles.listRow} onPress={() => handleActiveConnectionPress(dAppConnection)}>

0 commit comments

Comments
 (0)