diff options
author | Vendicated <vendicated@riseup.net> | 2023-04-05 04:34:39 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2023-04-05 04:34:39 +0200 |
commit | 6492908a62cbb8e56be6b28e574a3e9e33cc5051 (patch) | |
tree | 652f1f4db7361bafc2d8d689a03f5668c80ab4b0 /src/utils/updater.ts | |
parent | 676bc612d96c3d1d7c7a80e62bf8e50a2a6fb74b (diff) | |
download | Vencord-6492908a62cbb8e56be6b28e574a3e9e33cc5051.tar.gz Vencord-6492908a62cbb8e56be6b28e574a3e9e33cc5051.tar.bz2 Vencord-6492908a62cbb8e56be6b28e574a3e9e33cc5051.zip |
VencordDesktop: Fix Updater
Diffstat (limited to 'src/utils/updater.ts')
-rw-r--r-- | src/utils/updater.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/utils/updater.ts b/src/utils/updater.ts index d0b1fdc..3606e5f 100644 --- a/src/utils/updater.ts +++ b/src/utils/updater.ts @@ -62,7 +62,7 @@ export function getRepo() { return Unwrap(VencordNative.ipc.invoke<IpcRes<string>>(IpcEvents.GET_REPO)); } -type Hashes = Record<"patcher.js" | "preload.js" | "renderer.js" | "renderer.css", string>; +type Hashes = Record<"patcher.js" | "main.js" | "preload.js" | "renderer.js" | "renderer.css", string>; /** * @returns true if hard restart is required @@ -75,8 +75,11 @@ export async function rebuild() { const newHashes = await Unwrap(VencordNative.ipc.invoke<IpcRes<Hashes>>(IpcEvents.GET_HASHES)); - return oldHashes["patcher.js"] !== newHashes["patcher.js"] || - oldHashes["preload.js"] !== newHashes["preload.js"]; + if (oldHashes["preload.js"] !== newHashes["preload.js"]) return true; + if (IS_DISCORD_DESKTOP && oldHashes["patcher.js"] !== newHashes["patcher.js"]) return true; + if (IS_VENCORD_DESKTOP && oldHashes["main.js"] !== newHashes["main.js"]) return true; + + return false; } export async function maybePromptToUpdate(confirmMessage: string, checkForDev = false) { |