Files
hydra/src/main/events/user-preferences/auto-launch.ts
Chubby Granny Chaser dc7591ee28 feat: removing sentry
2024-05-14 16:54:14 +01:00

20 lines
430 B
TypeScript

import { registerEvent } from "../register-event";
import AutoLaunch from "auto-launch";
import { app } from "electron";
const autoLaunch = async (
_event: Electron.IpcMainInvokeEvent,
enabled: boolean
) => {
const appLauncher = new AutoLaunch({
name: app.getName(),
});
if (enabled) {
appLauncher.enable().catch();
} else {
appLauncher.disable().catch();
}
};
registerEvent("autoLaunch", autoLaunch);