add toggles for presence and patch

This commit is contained in:
2024-01-19 15:04:58 +01:00
parent cef085c13d
commit 61d5182854
11 changed files with 138 additions and 161 deletions

18
electron/updateCheck.js Normal file
View File

@@ -0,0 +1,18 @@
const semver = require("semver");
const { appVersion } = require("./appInfo");
const repoUrl =
"https://git.ez-pp.farm/api/v1/repos/EZPPFarm/EZPPLauncher/releases?limit=1";
module.exports = {
updateAvailable: async () => {
try {
const latestRelease = await fetch(repoUrl);
const json = await latestRelease.json();
if (json.length <= 0) return false;
return semver.lt(appVersion, json[0].tag_name);
} catch (err) {
return false;
}
},
};