diff --git a/components/ConnectWalletButton.tsx b/components/ConnectWalletButton.tsx index 9460ef2165..46dbd6d01e 100644 --- a/components/ConnectWalletButton.tsx +++ b/components/ConnectWalletButton.tsx @@ -23,6 +23,7 @@ import { } from '../utils/wallet-adapters' import Switch from './Switch' import { TwitterIcon } from './icons' +import { notify } from '@utils/notifications' const StyledWalletProviderLabel = styled.p` font-size: 0.65rem; @@ -78,7 +79,13 @@ const ConnectWalletButton = (props) => { } else { await current?.connect() } - } catch (e) { + } catch (e: any) { + if (e.name === 'WalletNotReadyError') { + notify({ + type: 'error', + message: 'You must have a wallet installed to connect', + }) + } console.warn('handleConnectDisconnect', e) } } diff --git a/pages/realms/index.tsx b/pages/realms/index.tsx index db2dae2861..3fe922605c 100644 --- a/pages/realms/index.tsx +++ b/pages/realms/index.tsx @@ -54,13 +54,20 @@ const Realms = () => { const handleCreateRealmButtonClick = async () => { if (!connected) { try { - if (wallet) await wallet.connect() + if (wallet) { + await wallet.connect() + } else { + throw new Error('You need to connect a wallet to continue') + } } catch (error) { const err = error as Error - return notify({ - type: 'error', - message: err.message, - }) + let message = err.message + + if (err.name === 'WalletNotReadyError') { + message = 'You must connect a wallet to create a DAO' + } + + return notify({ message, type: 'error' }) } } router.push(fmtUrlWithCluster(`/realms/new`))