From ce3ff8c3d810d7fe398ec92e78a600810215c5eb Mon Sep 17 00:00:00 2001 From: antelle Date: Wed, 28 Apr 2021 08:23:15 +0200 Subject: [PATCH] fixed extra file opened during auto-type --- app/scripts/auto-type/index.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/scripts/auto-type/index.js b/app/scripts/auto-type/index.js index e02fac90..9be1fe0b 100644 --- a/app/scripts/auto-type/index.js +++ b/app/scripts/auto-type/index.js @@ -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(); }); } };