handle objects in snackbar messages

metamask returns objects
This commit is contained in:
Barry Gitarts 2019-08-22 07:26:18 -04:00 committed by Barry G
parent 77850e472a
commit 3ba02674d1
1 changed files with 6 additions and 1 deletions

View File

@ -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 })