feat: add error logs

This commit is contained in:
Zamitto 2024-07-03 18:03:11 -03:00
parent 29b64237ed
commit 4be3db8007

View File

@ -3,6 +3,7 @@ import AutoLaunch from "auto-launch";
import { app } from "electron"; import { app } from "electron";
import path from "path"; import path from "path";
import fs from "node:fs"; import fs from "node:fs";
import { logger } from "@main/services";
const windowsStartupPath = path.join( const windowsStartupPath = path.join(
app.getPath("appData"), app.getPath("appData"),
@ -24,13 +25,17 @@ const autoLaunch = async (
}); });
if (enabled) { if (enabled) {
appLauncher.enable().catch(() => {}); appLauncher.enable().catch((err) => {
logger.error(err);
});
} else { } else {
if (process.platform == "win32") { if (process.platform == "win32") {
fs.rm(path.join(windowsStartupPath, "Hydra.vbs"), () => {}); fs.rm(path.join(windowsStartupPath, "Hydra.vbs"), () => {});
} }
appLauncher.disable().catch(() => {}); appLauncher.disable().catch((err) => {
logger.error(err);
});
} }
}; };