Merge branch 'main' into hyd-228-investigate-why-users-are-being-logged-out-when-updating

# Conflicts:
#	src/main/events/user-preferences/auto-launch.ts
This commit is contained in:
Zamitto
2024-07-03 16:32:25 -03:00
24 changed files with 142 additions and 154 deletions

View File

@@ -1,9 +1,6 @@
import { windowsStartupPath } from "@main/constants";
import { registerEvent } from "../register-event";
import AutoLaunch from "auto-launch";
import { app } from "electron";
import fs from "node:fs";
import path from "node:path";
const autoLaunch = async (
_event: Electron.IpcMainInvokeEvent,
@@ -15,23 +12,10 @@ const autoLaunch = async (
name: app.getName(),
});
if (process.platform == "win32") {
const destination = path.join(windowsStartupPath, "Hydra.vbs");
if (enabled) {
const scriptPath = path.join(process.resourcesPath, "hydralauncher.vbs");
fs.copyFileSync(scriptPath, destination);
} else {
appLauncher.disable().catch(() => {});
fs.rmSync(destination);
}
if (enabled) {
appLauncher.enable().catch(() => {});
} else {
if (enabled) {
appLauncher.enable().catch(() => {});
} else {
appLauncher.disable().catch(() => {});
}
appLauncher.disable().catch(() => {});
}
};