Fixing persisting error message from MobileSyncPage (#11835)

feature/default_network_editable
ryanml 3 years ago committed by GitHub
parent d1e264446d
commit 1837397202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ui/pages/mobile-sync/mobile-sync.component.js
  2. 2
      ui/pages/mobile-sync/mobile-sync.container.js

@ -28,6 +28,7 @@ export default class MobileSyncPage extends Component {
requestRevealSeedWords: PropTypes.func.isRequired, requestRevealSeedWords: PropTypes.func.isRequired,
exportAccounts: PropTypes.func.isRequired, exportAccounts: PropTypes.func.isRequired,
keyrings: PropTypes.array, keyrings: PropTypes.array,
hideWarning: PropTypes.func.isRequired,
}; };
state = { state = {
@ -277,6 +278,9 @@ export default class MobileSyncPage extends Component {
} }
componentWillUnmount() { componentWillUnmount() {
if (this.state.error) {
this.props.hideWarning();
}
this.clearTimeouts(); this.clearTimeouts();
this.disconnectWebsockets(); this.disconnectWebsockets();
} }

@ -4,6 +4,7 @@ import {
requestRevealSeedWords, requestRevealSeedWords,
fetchInfoToSync, fetchInfoToSync,
exportAccounts, exportAccounts,
hideWarning,
} from '../../store/actions'; } from '../../store/actions';
import { getMostRecentOverviewPage } from '../../ducks/history/history'; import { getMostRecentOverviewPage } from '../../ducks/history/history';
import { getMetaMaskKeyrings } from '../../selectors'; import { getMetaMaskKeyrings } from '../../selectors';
@ -17,6 +18,7 @@ const mapDispatchToProps = (dispatch) => {
displayWarning: (message) => dispatch(displayWarning(message || null)), displayWarning: (message) => dispatch(displayWarning(message || null)),
exportAccounts: (password, addresses) => exportAccounts: (password, addresses) =>
dispatch(exportAccounts(password, addresses)), dispatch(exportAccounts(password, addresses)),
hideWarning: () => dispatch(hideWarning()),
}; };
}; };

Loading…
Cancel
Save