Auto Update Relaunch Setting

This commit is contained in:
thororen 2024-12-03 04:04:13 -05:00
parent 98a35a42ca
commit c83152630f
3 changed files with 14 additions and 3 deletions

View file

@ -108,7 +108,8 @@ async function init() {
noPersist: true,
onClick: relaunch
}), 10_000);
return relaunch;
if (Settings.autoUpdateRelaunch) return relaunch;
return;
}
setTimeout(() => showNotification({

View file

@ -30,7 +30,8 @@ import plugins from "~plugins";
const logger = new Logger("Settings");
export interface Settings {
autoUpdate: boolean;
autoUpdateNotification: boolean,
autoUpdateRelaunch: boolean;
autoUpdateNotification: boolean;
useQuickCss: boolean;
enableReactDevtools: boolean;
themeLinks: string[];
@ -87,6 +88,7 @@ export interface Settings {
const DefaultSettings: Settings = {
autoUpdate: true,
autoUpdateRelaunch: false,
autoUpdateNotification: true,
useQuickCss: true,
themeLinks: [],

View file

@ -189,7 +189,7 @@ function Newer(props: CommonProps) {
}
function Updater() {
const settings = useSettings(["autoUpdate", "autoUpdateNotification"]);
const settings = useSettings(["autoUpdate", "autoUpdateRelaunch", "autoUpdateNotification"]);
const [repo, err, repoPending] = useAwaiter(getRepo, { fallbackValue: "Loading..." });
@ -221,6 +221,14 @@ function Updater() {
>
Get notified when an automatic update completes
</Switch>
<Switch
value={settings.autoUpdateRelaunch}
onChange={(v: boolean) => settings.autoUpdateRelaunch = v}
note="When automatically updating relaunch as well"
disabled={!settings.autoUpdate}
>
Get notified when an automatic update completes
</Switch>
<Forms.FormTitle tag="h5">Repo</Forms.FormTitle>