diff --git a/src/components/SettingsPage/sections/Profile.js b/src/components/SettingsPage/sections/Profile.js index 6352b023..62e2498b 100644 --- a/src/components/SettingsPage/sections/Profile.js +++ b/src/components/SettingsPage/sections/Profile.js @@ -51,16 +51,19 @@ class TabProfile extends PureComponent { isPasswordModalOpened: false, } - setPassword = hash => { + setPassword = password => { const { saveSettings, unlock } = this.props - setEncryptionKey('accounts', hash) - saveSettings({ - password: { - isEnabled: hash !== undefined, - value: hash, - }, + window.requestIdleCallback(() => { + setEncryptionKey('accounts', password) + const hash = password ? bcrypt.hashSync(password, 8) : undefined + saveSettings({ + password: { + isEnabled: hash !== undefined, + value: hash, + }, + }) + unlock() }) - unlock() } debounceSaveUsername = debounce( @@ -94,8 +97,7 @@ class TabProfile extends PureComponent { handleChangePassword = (password: ?string) => { if (password) { - const hash = bcrypt.hashSync(password, 8) - this.setPassword(hash) + this.setPassword(password) this.handleClosePasswordModal() } }