Make Updater slightly more future proof

- Removes the option to disable update notifications. Users really should not be outdated, so this option was never good. To disable notifications, turn on auto update
- Enables auto update by default. Users keep complaining about issues while being outdated, so this should help
- Update Notification now opens Updater in a modal to remove dependency on Settings patch. This makes it slightly more failsafe, it's unlikely that both modals and our settings patch break
This commit is contained in:
Vendicated 2024-04-20 14:51:33 +02:00
parent 0bebc85b0d
commit 8f73b9fd5f
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
5 changed files with 48 additions and 31 deletions

View file

@ -27,6 +27,7 @@ export { PlainSettings, Settings };
import "./utils/quickCss";
import "./webpack/patchWebpack";
import { openUpdaterModal } from "@components/VencordSettings/UpdaterTab";
import { StartAt } from "@utils/types";
import { get as dsGet } from "./api/DataStore";
@ -85,7 +86,7 @@ async function init() {
syncSettings();
if (!IS_WEB) {
if (!IS_WEB && !IS_UPDATER_DISABLED) {
try {
const isOutdated = await checkForUpdates();
if (!isOutdated) return;
@ -103,16 +104,13 @@ async function init() {
return;
}
if (Settings.notifyAboutUpdates)
setTimeout(() => showNotification({
title: "A Vencord update is available!",
body: "Click here to view the update",
permanent: true,
noPersist: true,
onClick() {
SettingsRouter.open("VencordUpdater");
}
}), 10_000);
setTimeout(() => showNotification({
title: "A Vencord update is available!",
body: "Click here to view the update",
permanent: true,
noPersist: true,
onClick: openUpdaterModal!
}), 10_000);
} catch (err) {
UpdateLogger.error("Failed to check for updates", err);
}