From 443978929b04630014f16bfb127013ec7c74cb6b Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 5 Oct 2022 16:47:28 +0200 Subject: [PATCH] Updater: Exclude more recent local commits --- src/utils/updater.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils/updater.ts b/src/utils/updater.ts index e66a1497..3b1cfa7c 100644 --- a/src/utils/updater.ts +++ b/src/utils/updater.ts @@ -1,6 +1,7 @@ import IpcEvents from "./IpcEvents"; import Logger from "./logger"; import { IpcRes } from './types'; +import gitHash from 'git-hash'; export const UpdateLogger = new Logger("Updater", "white"); export let isOutdated = false; @@ -18,6 +19,10 @@ async function Unwrap(p: Promise>) { export async function checkForUpdates() { changes = await Unwrap(VencordNative.ipc.invoke>(IpcEvents.GET_UPDATES)); + if (changes.some(c => c.hash === gitHash)) { + // git log NEWER...OLDER works as well. This means it will return the more recent local commits if the + changes = []; + } return (isOutdated = changes.length > 0); }