Skip to content

Commit

Permalink
make sure the previous modal is hidden before open a new one
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Jul 17, 2019
1 parent 0fb2836 commit 9a0f00f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/app/tabs/runTab/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,12 @@ class SettingsUI {
var account = $txOrigin.selectedOptions[0].value

var promptCb = (passphrase) => {
modalDialogCustom.promptMulti(signMessageDialog, (message) => {
const modal = modalDialogCustom.promptMulti(signMessageDialog, (message) => {
this.settings.signMessage(message, account, passphrase, (err, msgHash, signedData) => {
if (err) {
return addTooltip(err)
}
modal.hide()
modalDialogCustom.alert(yo`
<div>
<b>hash:</b><br>
Expand Down
5 changes: 3 additions & 2 deletions src/app/ui/modaldialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
}

function hide () {
if (container) container.style.display = 'none'
if (!container) return
container.style.display = 'none'
if (container.parentElement) container.parentElement.removeChild(container)
container = null
}
Expand Down Expand Up @@ -119,7 +120,7 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => {
}
})
}
return { container, okListener, cancelListener }
return { container, okListener, cancelListener, hide }
}

function html (opts) {
Expand Down

0 comments on commit 9a0f00f

Please sign in to comment.