mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-29 22:01:03 +00:00
chore: pulling from remote
This commit is contained in:
21
src/main/events/user-preferences/auto-launch.ts
Normal file
21
src/main/events/user-preferences/auto-launch.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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",
|
||||
});
|
||||
Reference in New Issue
Block a user