From 183739720290e76ccb074dcf5fe0a322745e08ba Mon Sep 17 00:00:00 2001 From: ryanml Date: Fri, 13 Aug 2021 12:59:06 -0700 Subject: [PATCH] Fixing persisting error message from MobileSyncPage (#11835) --- ui/pages/mobile-sync/mobile-sync.component.js | 4 ++++ ui/pages/mobile-sync/mobile-sync.container.js | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ui/pages/mobile-sync/mobile-sync.component.js b/ui/pages/mobile-sync/mobile-sync.component.js index e03e6eab2..fd4956dab 100644 --- a/ui/pages/mobile-sync/mobile-sync.component.js +++ b/ui/pages/mobile-sync/mobile-sync.component.js @@ -28,6 +28,7 @@ export default class MobileSyncPage extends Component { requestRevealSeedWords: PropTypes.func.isRequired, exportAccounts: PropTypes.func.isRequired, keyrings: PropTypes.array, + hideWarning: PropTypes.func.isRequired, }; state = { @@ -277,6 +278,9 @@ export default class MobileSyncPage extends Component { } componentWillUnmount() { + if (this.state.error) { + this.props.hideWarning(); + } this.clearTimeouts(); this.disconnectWebsockets(); } diff --git a/ui/pages/mobile-sync/mobile-sync.container.js b/ui/pages/mobile-sync/mobile-sync.container.js index 1172a97dc..9f70adae9 100644 --- a/ui/pages/mobile-sync/mobile-sync.container.js +++ b/ui/pages/mobile-sync/mobile-sync.container.js @@ -4,6 +4,7 @@ import { requestRevealSeedWords, fetchInfoToSync, exportAccounts, + hideWarning, } from '../../store/actions'; import { getMostRecentOverviewPage } from '../../ducks/history/history'; import { getMetaMaskKeyrings } from '../../selectors'; @@ -17,6 +18,7 @@ const mapDispatchToProps = (dispatch) => { displayWarning: (message) => dispatch(displayWarning(message || null)), exportAccounts: (password, addresses) => dispatch(exportAccounts(password, addresses)), + hideWarning: () => dispatch(hideWarning()), }; };