mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-18 19:50:58 -04:00
Updated SMTC Bridge version number v0.0.6 -> v1.0.0
This commit is contained in:
@@ -688,27 +688,18 @@ function VersionCheck(requiredVersion, installedVersion) {
|
|||||||
const [rMajor, rMinor, rPatch] = requiredVersion.split('.').map(Number);
|
const [rMajor, rMinor, rPatch] = requiredVersion.split('.').map(Number);
|
||||||
const [iMajor, iMinor, iPatch] = installedVersion.split('.').map(Number);
|
const [iMajor, iMinor, iPatch] = installedVersion.split('.').map(Number);
|
||||||
|
|
||||||
// 1. CRITICAL: Major versions must match exactly.
|
// Compare Major
|
||||||
if (iMajor !== rMajor) {
|
if (iMajor > rMajor) return 'compatible';
|
||||||
console.log(`VersionCheck: Major version mismatch. Required: ${rMajor}, Installed: ${iMajor}`);
|
if (iMajor < rMajor) return 'incompatible';
|
||||||
return 'incompatible';
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. SOFT WARNING: The installed minor version is lower than what is required.
|
// Major matches, compare Minor
|
||||||
if (iMinor < rMinor) {
|
if (iMinor > rMinor) return 'compatible';
|
||||||
console.log(`VersionCheck: Minor version mismatch. Required: ${rMinor}, Installed: ${iMinor}`);
|
if (iMinor < rMinor) return 'incompatible'; // or 'incompatible' depending on your policy
|
||||||
return 'soft-warning';
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. SILENT WARNING: Minors match, but the installed patch version is lagging.
|
// Major and Minor match, compare Patch
|
||||||
if (iMinor === rMinor && iPatch < rPatch) {
|
if (iPatch >= rPatch) return 'compatible';
|
||||||
console.log(`VersionCheck: Patch version mismatch. Required: ${rPatch}, Installed: ${iPatch}`);
|
|
||||||
return 'compatible';
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. PERFECT: Installed version meets or exceeds the required baseline.
|
return 'soft-warning'; // Installed patch is lower than required
|
||||||
console.log(`VersionCheck: Installed version meets or exceeds the required baseline. Required: ${requiredVersion}, Installed: ${installedVersion}`);
|
|
||||||
return 'compatible';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function SanitizeHTML(htmlString) {
|
function SanitizeHTML(htmlString) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const urlParams = new URLSearchParams(queryString);
|
|||||||
// CONSTANTS //
|
// CONSTANTS //
|
||||||
////////////////
|
////////////////
|
||||||
|
|
||||||
const REQUIRED_VERSION = '0.0.6';
|
const REQUIRED_VERSION = '1.0.0';
|
||||||
const SMTC_BRIDGE_DOWNLOAD_URL = 'https://github.com/nuttylmao/smtc-bridge/releases';
|
const SMTC_BRIDGE_DOWNLOAD_URL = 'https://github.com/nuttylmao/smtc-bridge/releases';
|
||||||
let VersionChecked = false;
|
let VersionChecked = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user