mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
name changes
This commit is contained in:
parent
970a3be280
commit
ce5b7a337d
5 changed files with 12 additions and 15 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue