mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-02 16:23:48 +03:00
name changes
This commit is contained in:
parent
970a3be280
commit
ce5b7a337d
@ -35,7 +35,6 @@
|
||||
"@sentry/electron": "^4.23.0",
|
||||
"@sentry/react": "^7.111.0",
|
||||
"@sentry/vite-plugin": "^2.16.1",
|
||||
"@types/auto-launch": "^5.0.5",
|
||||
"@vanilla-extract/css": "^1.14.2",
|
||||
"@vanilla-extract/recipes": "^0.5.2",
|
||||
"auto-launch": "^5.0.6",
|
||||
@ -68,6 +67,7 @@
|
||||
"@electron-toolkit/eslint-config-ts": "^1.0.1",
|
||||
"@electron-toolkit/tsconfig": "^1.0.1",
|
||||
"@swc/core": "^1.4.16",
|
||||
"@types/auto-launch": "^5.0.5",
|
||||
"@types/jsdom": "^21.1.6",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/node": "^20.12.7",
|
||||
|
@ -30,7 +30,7 @@ export class UserPreferences {
|
||||
preferQuitInsteadOfHiding: boolean;
|
||||
|
||||
@Column("boolean", { default: false })
|
||||
startWithSystem: boolean;
|
||||
runAtStartup: boolean;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt: Date;
|
||||
|
@ -1,21 +1,18 @@
|
||||
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: "Hydra",
|
||||
name: app.getName(),
|
||||
});
|
||||
if (enabled) {
|
||||
appLauncher
|
||||
.enable()
|
||||
.catch((err) => console.error("Error enabling auto-launch:", err));
|
||||
appLauncher.enable().catch();
|
||||
} else {
|
||||
appLauncher
|
||||
.disable()
|
||||
.catch((err) => console.error("Error disabling auto-launch:", err));
|
||||
appLauncher.disable().catch();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -12,7 +12,7 @@ export function Settings() {
|
||||
repackUpdatesNotificationsEnabled: false,
|
||||
telemetryEnabled: false,
|
||||
preferQuitInsteadOfHiding: false,
|
||||
startWithSystem: false,
|
||||
runAtStartup: false,
|
||||
});
|
||||
|
||||
const { t } = useTranslation("settings");
|
||||
@ -31,7 +31,7 @@ export function Settings() {
|
||||
telemetryEnabled: userPreferences?.telemetryEnabled ?? false,
|
||||
preferQuitInsteadOfHiding:
|
||||
userPreferences?.preferQuitInsteadOfHiding ?? false,
|
||||
startWithSystem: userPreferences?.startWithSystem ?? false,
|
||||
runAtStartup: userPreferences?.runAtStartup ?? false,
|
||||
});
|
||||
});
|
||||
}, []);
|
||||
@ -129,10 +129,10 @@ export function Settings() {
|
||||
<CheckboxField
|
||||
label={t("launch_with_system")}
|
||||
onChange={() => {
|
||||
updateUserPreferences("startWithSystem", !form.startWithSystem);
|
||||
window.electron.autoLaunch(!form.startWithSystem);
|
||||
updateUserPreferences("runAtStartup", !form.runAtStartup);
|
||||
window.electron.autoLaunch(!form.runAtStartup);
|
||||
}}
|
||||
checked={form.startWithSystem}
|
||||
checked={form.runAtStartup}
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -106,7 +106,7 @@ export interface UserPreferences {
|
||||
repackUpdatesNotificationsEnabled: boolean;
|
||||
telemetryEnabled: boolean;
|
||||
preferQuitInsteadOfHiding: boolean;
|
||||
startWithSystem: boolean;
|
||||
runAtStartup: boolean;
|
||||
}
|
||||
|
||||
export interface HowLongToBeatCategory {
|
||||
|
Loading…
Reference in New Issue
Block a user