|
|
@ -68,9 +68,14 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
|
|
|
|
|
|
|
|
|
|
|
|
this.hasPassword();
|
|
|
|
this.hasPassword();
|
|
|
|
this.refreshLinkedDevice = this.refreshLinkedDevice.bind(this);
|
|
|
|
this.refreshLinkedDevice = this.refreshLinkedDevice.bind(this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.onKeyUp = this.onKeyUp.bind(this);
|
|
|
|
|
|
|
|
window.addEventListener('keyup', this.onKeyUp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public componentDidMount() {
|
|
|
|
public componentDidMount() {
|
|
|
|
|
|
|
|
setTimeout(() => $('#password-lock-input').focus(), 100);
|
|
|
|
|
|
|
|
|
|
|
|
window.Whisper.events.on('refreshLinkedDeviceList', async () => {
|
|
|
|
window.Whisper.events.on('refreshLinkedDeviceList', async () => {
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
this.refreshLinkedDevice();
|
|
|
|
this.refreshLinkedDevice();
|
|
|
@ -552,4 +557,14 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private async onKeyUp(event: any) {
|
|
|
|
|
|
|
|
const lockPasswordFocussed = $('#password-lock-input').is(':focus');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (event.key === 'Enter' && lockPasswordFocussed) {
|
|
|
|
|
|
|
|
await this.validatePasswordLock();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|