mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
a2a997df30
* [*] ESLint: The Lintening * Missed a couple unused vals in utils * [*] Tend to DeepScan remarks * [*] sigh, remove some duplicate crap
22 lines
963 B
TypeScript
22 lines
963 B
TypeScript
// What does this do?
|
|
// In case of faulty update of ArmCord we can quickly push an update to the user and possibly try to fix it
|
|
// This is completely optional and is disabled by default in settings
|
|
import {ipcRenderer} from "electron";
|
|
import {injectJS} from "../utils";
|
|
|
|
const patchEndpoint = "https://patch.armcord.xyz";
|
|
const version = ipcRenderer.sendSync("get-app-version", "app-version");
|
|
if (ipcRenderer.sendSync("shouldPatch")) {
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
fetch(`${patchEndpoint}/${version}/info.json`, {cache: "no-store"}) //lmao
|
|
.then((res) => res.json())
|
|
.then((res) => {
|
|
if (res.patch == true) {
|
|
console.log("Found a patch. Injecting...");
|
|
injectJS(`${patchEndpoint}/${version}/patch.js`);
|
|
} else {
|
|
console.log("No patches have been found.");
|
|
}
|
|
});
|
|
});
|
|
}
|