1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/main/exit-app.ts
Jari Kolehmainen ac35bab987
Fix 'cannot read property hide of null' error on quit (#1594)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2020-12-03 14:55:19 +02:00

20 lines
577 B
TypeScript

import { app } from "electron";
import { WindowManager } from "./window-manager";
import { appEventBus } from "../common/event-bus";
import { ClusterManager } from "./cluster-manager";
import logger from "./logger";
export function exitApp() {
const windowManager = WindowManager.getInstance<WindowManager>();
const clusterManager = ClusterManager.getInstance<ClusterManager>();
appEventBus.emit({ name: "service", action: "close" });
windowManager?.hide();
clusterManager?.stop();
logger.info("SERVICE:QUIT");
setTimeout(() => {
app.exit();
}, 1000);
}