diff --git a/apps/desktop/src/autofill/main/main-desktop-autotype.service.ts b/apps/desktop/src/autofill/main/main-desktop-autotype.service.ts index 655bd4ae5fd..c879e9ea42e 100644 --- a/apps/desktop/src/autofill/main/main-desktop-autotype.service.ts +++ b/apps/desktop/src/autofill/main/main-desktop-autotype.service.ts @@ -12,7 +12,6 @@ import { AutotypeKeyboardShortcut } from "../models/main-autotype-keyboard-short export class MainDesktopAutotypeService { autotypeKeyboardShortcut: AutotypeKeyboardShortcut; - private isInitialized: boolean = false; constructor( private logService: LogService, @@ -20,16 +19,10 @@ export class MainDesktopAutotypeService { ) { this.autotypeKeyboardShortcut = new AutotypeKeyboardShortcut(); - ipcMain.handle(AUTOTYPE_IPC_CHANNELS.INIT, () => { - this.init(); - }); - - ipcMain.handle(AUTOTYPE_IPC_CHANNELS.INITIALIZED, () => { - return this.isInitialized; - }); + this.registerHandlers(); } - init() { + registerHandlers() { ipcMain.on(AUTOTYPE_IPC_CHANNELS.TOGGLE, (_event, enable: boolean) => { if (enable) { this.enableAutotype(); @@ -58,8 +51,6 @@ export class MainDesktopAutotypeService { this.doAutotype(vaultData, this.autotypeKeyboardShortcut.getArrayFormat()); } }); - - this.isInitialized = true; } // Deregister the keyboard shortcut if registered. @@ -75,8 +66,6 @@ export class MainDesktopAutotypeService { } dispose() { - ipcMain.removeHandler(AUTOTYPE_IPC_CHANNELS.INIT); - ipcMain.removeHandler(AUTOTYPE_IPC_CHANNELS.INITIALIZED); ipcMain.removeAllListeners(AUTOTYPE_IPC_CHANNELS.TOGGLE); ipcMain.removeAllListeners(AUTOTYPE_IPC_CHANNELS.CONFIGURE); ipcMain.removeAllListeners(AUTOTYPE_IPC_CHANNELS.EXECUTE); diff --git a/apps/desktop/src/autofill/preload.ts b/apps/desktop/src/autofill/preload.ts index 71f7867cbdd..77b5256b020 100644 --- a/apps/desktop/src/autofill/preload.ts +++ b/apps/desktop/src/autofill/preload.ts @@ -131,12 +131,6 @@ export default { }, ); }, - initAutotype: () => { - return ipcRenderer.invoke(AUTOTYPE_IPC_CHANNELS.INIT); - }, - autotypeIsInitialized: () => { - return ipcRenderer.invoke(AUTOTYPE_IPC_CHANNELS.INITIALIZED); - }, configureAutotype: (config: AutotypeConfig) => { ipcRenderer.send(AUTOTYPE_IPC_CHANNELS.CONFIGURE, config); }, diff --git a/apps/desktop/src/autofill/services/desktop-autotype.service.ts b/apps/desktop/src/autofill/services/desktop-autotype.service.ts index 9e4d9ac0229..466ba87b47b 100644 --- a/apps/desktop/src/autofill/services/desktop-autotype.service.ts +++ b/apps/desktop/src/autofill/services/desktop-autotype.service.ts @@ -117,10 +117,6 @@ export class DesktopAutotypeService implements OnDestroy { return; } - if (!(await ipc.autofill.autotypeIsInitialized())) { - await ipc.autofill.initAutotype(); - } - ipc.autofill.listenAutotypeRequest(async (windowTitle, callback) => { const possibleCiphers = await this.matchCiphersToWindowTitle(windowTitle); const firstCipher = possibleCiphers?.at(0);