handle objects in snackbar messages
metamask returns objects
This commit is contained in:
parent
77850e472a
commit
3ba02674d1
|
@ -80,8 +80,13 @@ class App extends React.Component {
|
|||
}
|
||||
|
||||
openSnackBar = (variant, message) => {
|
||||
if (typeof message === 'object') {
|
||||
const msg = message.message
|
||||
this.setState({ snackbar: { variant, message: msg } })
|
||||
} else {
|
||||
this.setState({ snackbar: { variant, message } })
|
||||
}
|
||||
}
|
||||
|
||||
closeSnackBar = () => {
|
||||
this.setState({ snackbar: null })
|
||||
|
|
Loading…
Reference in New Issue