|
@ -51,9 +51,11 @@ class TabProfile extends PureComponent<Props, State> { |
|
|
isPasswordModalOpened: false, |
|
|
isPasswordModalOpened: false, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
setPassword = hash => { |
|
|
setPassword = password => { |
|
|
const { saveSettings, unlock } = this.props |
|
|
const { saveSettings, unlock } = this.props |
|
|
setEncryptionKey('accounts', hash) |
|
|
window.requestIdleCallback(() => { |
|
|
|
|
|
setEncryptionKey('accounts', password) |
|
|
|
|
|
const hash = password ? bcrypt.hashSync(password, 8) : undefined |
|
|
saveSettings({ |
|
|
saveSettings({ |
|
|
password: { |
|
|
password: { |
|
|
isEnabled: hash !== undefined, |
|
|
isEnabled: hash !== undefined, |
|
@ -61,6 +63,7 @@ class TabProfile extends PureComponent<Props, State> { |
|
|
}, |
|
|
}, |
|
|
}) |
|
|
}) |
|
|
unlock() |
|
|
unlock() |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
debounceSaveUsername = debounce( |
|
|
debounceSaveUsername = debounce( |
|
@ -94,8 +97,7 @@ class TabProfile extends PureComponent<Props, State> { |
|
|
|
|
|
|
|
|
handleChangePassword = (password: ?string) => { |
|
|
handleChangePassword = (password: ?string) => { |
|
|
if (password) { |
|
|
if (password) { |
|
|
const hash = bcrypt.hashSync(password, 8) |
|
|
this.setPassword(password) |
|
|
this.setPassword(hash) |
|
|
|
|
|
this.handleClosePasswordModal() |
|
|
this.handleClosePasswordModal() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|