mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-24 11:21:02 +00:00
22 lines
443 B
TypeScript
22 lines
443 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, {
|
|
name: "autoLaunch",
|
|
});
|