mirror of
https://github.com/bitwarden/browser
synced 2025-12-29 14:43:31 +00:00
claude: remove the init/init'd
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user