Skip to content

Commit

Permalink
fix: snackbar ui
Browse files Browse the repository at this point in the history
  • Loading branch information
guanbinrui committed May 9, 2022
1 parent beb0d87 commit b6e9fdf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useEffect, useState } from 'react'
import { useAsyncRetry } from 'react-use'
import { DialogContent } from '@mui/material'
import { makeStyles, useSnackbar } from '@masknet/theme'
import { makeStyles, usePopupCustomSnackbar, useSnackbar } from '@masknet/theme'
import { safeUnreachable, delay } from '@dimensiondev/kit'
import {
ChainId,
Expand Down Expand Up @@ -167,16 +167,16 @@ export function ConnectWalletDialog(props: ConnectWalletDialogProps) {
return true
}, [open, connectTo, setConnectWalletDialog])

const { enqueueSnackbar } = useSnackbar()
const { showSnackbar } = usePopupCustomSnackbar()
useEffect(() => {
if (!isPopupPage() || !connection.error) return
setConnectWalletDialog({
open: false,
})
enqueueSnackbar(connection.error.message, {
showSnackbar(connection.error.message, {
variant: 'error',
})
}, [connection.error, enqueueSnackbar])
}, [connection.error, showSnackbar])

if (!providerType) return null

Expand Down

0 comments on commit b6e9fdf

Please sign in to comment.