Skip to content

Commit

Permalink
Hides notification after signing
Browse files Browse the repository at this point in the history
  • Loading branch information
comountainclimber committed Jun 19, 2019
1 parent b471b2e commit f4f73b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Expand Up @@ -31,9 +31,10 @@ type Tx = {

type Props = {
hideModal: () => void,
showErrorNotification: ({ message: string }) => void,
showSuccessNotification: ({ message: string }) => void,
showInfoNotification: ({ message: string }) => void,
showErrorNotification: ({ message: string }) => string,
showSuccessNotification: ({ message: string }) => string,
showInfoNotification: ({ message: string }) => string,
hideNotification: (id: string) => void,
wif: string,
tx: Tx,
net: string,
Expand Down Expand Up @@ -73,11 +74,12 @@ export default class GeneratedTransactionModal extends React.Component<
isHardwareLogin,
signingFunction,
showInfoNotification,
hideNotification,
publicKey,
} = this.props
const Tx = new Transaction(JSON.parse(this.state.transaction))
if (isHardwareLogin) {
showInfoNotification({
const notificationId = showInfoNotification({
message: 'Please sign the transaction on your hardware device',
autoDismiss: 0,
})
Expand All @@ -88,6 +90,7 @@ export default class GeneratedTransactionModal extends React.Component<
}
const signingPromise = api.signTx(config)
signingPromise.then(config => {
hideNotification(notificationId)
const signedTx = config.tx
this.setState({
signedTx,
Expand Down
2 changes: 2 additions & 0 deletions app/components/Modals/ImportTransactionModal/index.js
Expand Up @@ -8,6 +8,7 @@ import {
showErrorNotification,
showSuccessNotification,
showInfoNotification,
hideNotification,
} from '../../../modules/notifications'
import withAuthData from '../../../hocs/withAuthData'
import withNetworkData from '../../../hocs/withNetworkData'
Expand All @@ -17,6 +18,7 @@ const actionCreators = {
showErrorNotification,
showSuccessNotification,
showInfoNotification,
hideNotification,
}

const mapDispatchToProps = dispatch =>
Expand Down

0 comments on commit f4f73b5

Please sign in to comment.