OSDN Git Service

fixed the error show bug when electron start
authorZhiting Lin <zlin035@uottawa.ca>
Tue, 10 Apr 2018 02:22:30 +0000 (10:22 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Tue, 10 Apr 2018 02:22:30 +0000 (10:22 +0800)
src/features/app/components/Container.jsx

index bd9e7f3..517e36c 100644 (file)
@@ -46,7 +46,10 @@ class Container extends React.Component {
         this.props.uptdateLang(arg)
       })
       window.ipcRenderer.on('ConfiguredNetwork', (event, arg) => {
-        if(arg === 'starNode'){
+        if(arg === 'startNode'){
+          Object.keys(this.props.flashMessages).forEach(key => {
+            delete this.props.flashMessages[key]
+          })
           this.props.showRoot()
         }
         if(arg === 'init'){
@@ -108,6 +111,7 @@ export default connect(
     configKnown: state.core.configKnown,
     configured: state.core.configured,
     onTestnet: state.core.onTestnet,
+    flashMessages: state.app.flashMessages,
   }),
   (dispatch) => ({
     fetchInfo: options => dispatch(actions.core.fetchCoreInfo(options)),
@@ -115,6 +119,7 @@ export default connect(
     showConfiguration: () => dispatch(actions.app.showConfiguration()),
     uptdateBtmAmountUnit: (param) => dispatch(actions.core.updateBTMAmountUnit(param)),
     uptdateLang: (param) => dispatch(actions.core.updateLang(param)),
-    updateConfiguredStatus: () => dispatch(actions.core.updateConfiguredStatus)
+    updateConfiguredStatus: () => dispatch(actions.core.updateConfiguredStatus),
+    markFlashDisplayed: (key) => dispatch(actions.app.displayedFlash(key)),
   })
 )(Container)