From 3ba02674d17ce05865d535791eaf139af77d0246 Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Thu, 22 Aug 2019 07:26:18 -0400 Subject: [PATCH] handle objects in snackbar messages metamask returns objects --- src/dapp.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dapp.js b/src/dapp.js index 60a1e4c..461beab 100644 --- a/src/dapp.js +++ b/src/dapp.js @@ -80,7 +80,12 @@ class App extends React.Component { } openSnackBar = (variant, message) => { - this.setState({ snackbar: { variant, message } }) + if (typeof message === 'object') { + const msg = message.message + this.setState({ snackbar: { variant, message: msg } }) + } else { + this.setState({ snackbar: { variant, message } }) + } } closeSnackBar = () => {