Close the password window once mainwindow is focused

password was closed to early and no windows were shown which triggered
the app stop
pull/1036/head
Audric Ackermann 5 years ago
parent 7449e90dec
commit b39ac9f44e
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -346,6 +346,10 @@ async function createWindow() {
mainWindow.on('focus', () => {
mainWindow.flashFrame(false);
if (passwordWindow) {
passwordWindow.close();
passwordWindow = null;
}
});
if (config.environment === 'test') {
@ -1018,11 +1022,6 @@ ipc.on('password-window-login', async (event, passPhrase) => {
const passwordAttempt = true;
await showMainWindow(passPhrase, passwordAttempt);
sendResponse();
if (passwordWindow) {
passwordWindow.close();
passwordWindow = null;
}
} catch (e) {
const localisedError = locale.messages.invalidPassword.message;
sendResponse(localisedError || 'Invalid password');

Loading…
Cancel
Save