aboutsummaryrefslogtreecommitdiff
path: root/src/Vencord.ts
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-10-16 17:15:15 +0200
committerVendicated <vendicated@riseup.net>2022-10-16 17:15:15 +0200
commit01ae0983b378ca478e7b6891e183718e8c45ed02 (patch)
treeaac88bfa3bf4308fa067377c814fdd45a5601971 /src/Vencord.ts
parent845088ec024d56af4d7fdd4cd861c2aa89dbceb6 (diff)
downloadVencord-01ae0983b378ca478e7b6891e183718e8c45ed02.tar.gz
Vencord-01ae0983b378ca478e7b6891e183718e8c45ed02.tar.bz2
Vencord-01ae0983b378ca478e7b6891e183718e8c45ed02.zip
Optimise Web via treeshaking, cleanup build scripts
Diffstat (limited to 'src/Vencord.ts')
-rw-r--r--src/Vencord.ts38
1 files changed, 17 insertions, 21 deletions
diff --git a/src/Vencord.ts b/src/Vencord.ts
index 4800621..659d032 100644
--- a/src/Vencord.ts
+++ b/src/Vencord.ts
@@ -17,12 +17,6 @@ import { checkForUpdates, UpdateLogger } from "./utils/updater";
import { onceReady } from "./webpack";
import { Router } from "./webpack/common";
-Object.defineProperty(window, "IS_WEB", {
- get: () => !window.DiscordNative,
- configurable: true,
- enumerable: true
-});
-
export let Components: any;
async function init() {
@@ -30,21 +24,23 @@ async function init() {
startAllPlugins();
Components = await import("./components");
- try {
- const isOutdated = await checkForUpdates();
- if (isOutdated && Settings.notifyAboutUpdates)
- setTimeout(() => {
- showNotice(
- "A Vencord update is available!",
- "View Update",
- () => {
- popNotice();
- Router.open("VencordUpdater");
- }
- );
- }, 10000);
- } catch (err) {
- UpdateLogger.error("Failed to check for updates", err);
+ if (!IS_WEB) {
+ try {
+ const isOutdated = await checkForUpdates();
+ if (isOutdated && Settings.notifyAboutUpdates)
+ setTimeout(() => {
+ showNotice(
+ "A Vencord update is available!",
+ "View Update",
+ () => {
+ popNotice();
+ Router.open("VencordUpdater");
+ }
+ );
+ }, 10000);
+ } catch (err) {
+ UpdateLogger.error("Failed to check for updates", err);
+ }
}
}