fixed extra file opened during auto-type

This commit is contained in:
antelle 2021-04-28 08:23:15 +02:00
parent 1789d9bb67
commit ce3ff8c3d8
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
1 changed files with 11 additions and 3 deletions

View File

@ -240,7 +240,9 @@ const AutoType = {
},
focusMainWindow() {
setTimeout(() => Launcher.showMainWindow(), Timeouts.RedrawInactiveWindow);
if (!Launcher.isAppFocused()) {
setTimeout(() => Launcher.showMainWindow(), Timeouts.RedrawInactiveWindow);
}
},
processEventWithFilter(evt) {
@ -270,9 +272,15 @@ const AutoType = {
});
});
this.selectEntryView.render();
this.selectEntryView.on('show-open-files', () => {
this.selectEntryView.on('show-open-files', async () => {
this.selectEntryView.hide();
Events.emit('open-file');
try {
await AppModel.instance.unlockAnyFile('autoTypeUnlockMessage');
} catch {
return;
}
this.selectEntryView.show();
this.selectEntryView.render();
});
}
};