diff options
Diffstat (limited to 'ui/app/app.js')
-rw-r--r-- | ui/app/app.js | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/ui/app/app.js b/ui/app/app.js index 5405f8495..7669a5db9 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -43,6 +43,10 @@ const Alert = require('./components/alert') import AppHeader from './components/app-header' import UnlockPage from './components/pages/unlock-page' +import { + submittedPendingTransactionsSelector, +} from './selectors/transactions' + // Routes const { DEFAULT_ROUTE, @@ -106,12 +110,21 @@ class App extends Component { currentView, setMouseUserState, sidebar, + submittedPendingTransactions, } = this.props const isLoadingNetwork = network === 'loading' && currentView.name !== 'config' const loadMessage = loadingMessage || isLoadingNetwork ? this.getConnectingLabel(loadingMessage) : null log.debug('Main ui render function') + const { + isOpen: sidebarIsOpen, + transitionName: sidebarTransitionName, + type: sidebarType, + props, + } = sidebar + const { transaction: sidebarTransaction } = props || {} + return ( h('.flex-column.full-height', { className: classnames({ 'mouse-user-styles': isMouseUser }), @@ -139,10 +152,12 @@ class App extends Component { // sidebar h(Sidebar, { - sidebarOpen: sidebar.isOpen, + sidebarOpen: sidebarIsOpen, + sidebarShouldClose: sidebarTransaction && !submittedPendingTransactions.find(({ id }) => id === sidebarTransaction.id), hideSidebar: this.props.hideSidebar, - transitionName: sidebar.transitionName, - type: sidebar.type, + transitionName: sidebarTransitionName, + type: sidebarType, + sidebarProps: sidebar.props, }), // network dropdown @@ -254,6 +269,7 @@ App.propTypes = { activeAddress: PropTypes.string, unapprovedTxs: PropTypes.object, seedWords: PropTypes.string, + submittedPendingTransactions: PropTypes.array, unapprovedMsgCount: PropTypes.number, unapprovedPersonalMsgCount: PropTypes.number, unapprovedTypedMessagesCount: PropTypes.number, @@ -313,6 +329,7 @@ function mapStateToProps (state) { isOnboarding: Boolean(!noActiveNotices || seedWords || !isInitialized), isPopup: state.metamask.isPopup, seedWords: state.metamask.seedWords, + submittedPendingTransactions: submittedPendingTransactionsSelector(state), unapprovedTxs, unapprovedMsgs: state.metamask.unapprovedMsgs, unapprovedMsgCount, |