diff options
Use callback in placeSeedWord method.
When displaying seed words, we were not using a callback, which had some race condition potential. This is simply a little cleaner and more correct.
Fixes #842
Diffstat (limited to 'app/scripts/keyring-controller.js')
-rw-r--r-- | app/scripts/keyring-controller.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index cf761c88c..49a41df66 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -173,10 +173,15 @@ module.exports = class KeyringController extends EventEmitter { }) } - placeSeedWords () { + placeSeedWords (cb) { const firstKeyring = this.keyrings[0] const seedWords = firstKeyring.serialize().mnemonic this.configManager.setSeedWords(seedWords) + + if (cb && typeof cb === 'function') { + cb() + this.emit('update') + } } submitPassword (password, cb) { |