Skip to content

Commit 793c9ff

Browse files
authored
[improves] fix device (#41)
1 parent bc48b71 commit 793c9ff

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/components/Image/util/images.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,17 @@ export const logos = [
4141
'connector/taho',
4242
'connector/zengo',
4343
'connector/ledger',
44-
'connector/ledgerLive',
4544
'connector/portis',
4645
'connector/binance',
4746
'connector/coinbase',
4847
'connector/metamask',
4948
'connector/gnosisSafe',
49+
'connector/ledgerLive',
5050
'connector/trustWallet',
5151
'connector/braveBrowser',
5252
'connector/walletConnect',
5353
'connector/monitorAddress',
54+
5455
'image/error',
5556
'image/magic',
5657
'image/success',

src/layouts/AppLayout/Header/Connect/Account/AccountMenu/AccountMenu.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ type AccountMenuProps = {
1515
logo: LogoProps['name']
1616
}
1717

18+
const disableDisconnect = new Set<string>([
19+
wallets.dAppBrowser.id,
20+
wallets.ledgerLive.id,
21+
])
22+
1823
const AccountMenu: React.FC<AccountMenuProps> = (props) => {
1924
const { logo } = props
2025

2126
const { activeWallet } = useConfig()
2227
const claimsTotal = useClaimsTotal()
2328

24-
const NON_DISCONNECTABLE_WALLET_IDS = new Set<string>([
25-
wallets.dAppBrowser.id,
26-
wallets.ledgerLive.id,
27-
])
28-
29-
const shouldShowDisconnect = activeWallet !== null && !NON_DISCONNECTABLE_WALLET_IDS.has(activeWallet)
29+
const shouldShowDisconnect = activeWallet !== null && !disableDisconnect.has(activeWallet)
3030

3131
return (
3232
<>

src/modules/device/ctx.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ const {
4444

4545
handleSetDevice()
4646

47+
tabletMediaQuery.addEventListener('change', handleSetDevice)
4748
desktopMediaQuery.addEventListener('change', handleSetDevice)
4849

4950
return () => {
51+
tabletMediaQuery.removeEventListener('change', handleSetDevice)
5052
desktopMediaQuery.removeEventListener('change', handleSetDevice)
5153
}
5254
}, [ onChange ])

0 commit comments

Comments
 (0)