mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 06:03:03 -04:00
Updater: Inform about more recent commits
This commit is contained in:
parent
443978929b
commit
25fcc528ea
2 changed files with 82 additions and 50 deletions
|
@ -5,6 +5,7 @@ import gitHash from 'git-hash';
|
|||
|
||||
export const UpdateLogger = new Logger("Updater", "white");
|
||||
export let isOutdated = false;
|
||||
export let isNewer = false;
|
||||
export let updateError: any;
|
||||
export let changes: Record<"hash" | "author" | "message", string>[];
|
||||
|
||||
|
@ -20,8 +21,8 @@ async function Unwrap<T>(p: Promise<IpcRes<T>>) {
|
|||
export async function checkForUpdates() {
|
||||
changes = await Unwrap(VencordNative.ipc.invoke<IpcRes<typeof changes>>(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 = [];
|
||||
isNewer = true;
|
||||
return (isOutdated = false);
|
||||
}
|
||||
return (isOutdated = changes.length > 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue