import { IpcEmitter } from "./ipc-emitter";
import { ipcMain } from "electron";
import { IpcChannels } from "./ipc-channels";

export class ProductionIpcEmitter implements IpcEmitter {
    public emitResetUserInput(): void {
        ipcMain.emit(IpcChannels.resetUserInput);
    }

    public emitHideWindow(): void {
        ipcMain.emit(IpcChannels.hideWindow);
    }
}

import { IpcEmitter } from "./ipc-emitter";
import { ipcMain } from "electron";
import { IpcChannels } from "./ipc-channels";

export class ProductionIpcEmitter implements IpcEmitter {
    private windowHideDelayInMilliSeconds = 50;

    public emitResetUserInput(): void {
        ipcMain.emit(IpcChannels.resetUserInput);
    }

    public emitHideWindow(): void {

        setTimeout((): void => {
            ipcMain.emit(IpcChannels.hideWindow);
        }, this.windowHideDelayInMilliSeconds); // set delay when hiding main window so user input can be reset properly
    }
}

Set delay when hiding window (again)
Set delay when hiding window (again)
