diff options
author | V <vendicated@riseup.net> | 2023-04-09 04:04:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-09 04:04:02 +0200 |
commit | 08822dd19064ea5b707117c5ed51f62dd0a8e316 (patch) | |
tree | 1020c2dad28f5dc502f797ca09066145fcc12109 /src/Vencord.ts | |
parent | bfa20f2634a0f3f73a03135f9ddb9d0dfe566e88 (diff) | |
download | Vencord-08822dd19064ea5b707117c5ed51f62dd0a8e316.tar.gz Vencord-08822dd19064ea5b707117c5ed51f62dd0a8e316.tar.bz2 Vencord-08822dd19064ea5b707117c5ed51f62dd0a8e316.zip |
Improvements for VencordDesktop (#847)
Diffstat (limited to 'src/Vencord.ts')
-rw-r--r-- | src/Vencord.ts | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/Vencord.ts b/src/Vencord.ts index a23b1a8..f11ca16 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -27,12 +27,14 @@ export { PlainSettings, Settings }; import "./utils/quickCss"; import "./webpack/patchWebpack"; +import { relaunch } from "@utils/native"; + import { showNotification } from "./api/Notifications"; import { PlainSettings, Settings } from "./api/settings"; import { patches, PMLogger, startAllPlugins } from "./plugins"; import { localStorage } from "./utils/localStorage"; import { getCloudSettings, putCloudSettings } from "./utils/settingsSync"; -import { checkForUpdates, rebuild, update, UpdateLogger } from "./utils/updater"; +import { checkForUpdates, rebuild, update,UpdateLogger } from "./utils/updater"; import { onceReady } from "./webpack"; import { SettingsRouter } from "./webpack/common"; @@ -75,23 +77,14 @@ async function init() { if (Settings.autoUpdate) { await update(); - const needsFullRestart = await rebuild(); + await rebuild(); if (Settings.autoUpdateNotification) setTimeout(() => showNotification({ title: "Vencord has been updated!", body: "Click here to restart", permanent: true, noPersist: true, - onClick() { - if (needsFullRestart) { - if (IS_DISCORD_DESKTOP) - window.DiscordNative.app.relaunch(); - else - window.VencordDesktop.app.relaunch(); - } - else - location.reload(); - } + onClick: relaunch }), 10_000); return; } |