[macOS] Don't enable secure input when app is not in focus (#419)
* Don't engage macOS secure input if not focused * Refactor to use focusInputOnPageLoad * Refactor to remove focusInputOnPageLoad
This commit is contained in:
parent
9ee31ad2fb
commit
6f6b5a5503
|
@ -58,8 +58,8 @@ export class LoginComponent implements OnInit {
|
||||||
if (this.rememberEmail == null) {
|
if (this.rememberEmail == null) {
|
||||||
this.rememberEmail = true;
|
this.rememberEmail = true;
|
||||||
}
|
}
|
||||||
if (Utils.isBrowser) {
|
if (Utils.isBrowser && !Utils.isNode) {
|
||||||
document.getElementById(this.email == null || this.email === '' ? 'email' : 'masterPassword').focus();
|
this.focusInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,4 +143,8 @@ export class LoginComponent implements OnInit {
|
||||||
'&redirectUri=' + encodeURIComponent(ssoRedirectUri) +
|
'&redirectUri=' + encodeURIComponent(ssoRedirectUri) +
|
||||||
'&state=' + state + '&codeChallenge=' + codeChallenge);
|
'&state=' + state + '&codeChallenge=' + codeChallenge);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected focusInput() {
|
||||||
|
document.getElementById(this.email == null || this.email === '' ? 'email' : 'masterPassword').focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,6 +174,12 @@ export class WindowMain {
|
||||||
this.win.on('move', () => {
|
this.win.on('move', () => {
|
||||||
this.windowStateChangeHandler(Keys.mainWindowSize, this.win);
|
this.windowStateChangeHandler(Keys.mainWindowSize, this.win);
|
||||||
});
|
});
|
||||||
|
this.win.on('focus', () => {
|
||||||
|
this.win.webContents.send('messagingService', {
|
||||||
|
command: 'windowIsFocused',
|
||||||
|
windowIsFocused: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
if (this.createWindowCallback) {
|
if (this.createWindowCallback) {
|
||||||
this.createWindowCallback(this.win);
|
this.createWindowCallback(this.win);
|
||||||
|
|
Loading…
Reference in New Issue