From 6b1e2df58993c28c3b5f4f830a4ea61bd9f83902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 5 Oct 2020 15:24:01 +0200 Subject: [PATCH] extensionUtils: Adjust version check With the new versioning scheme, the previously-minor version gets shifted up to major, and unstable releases are marked by non-numeric "versions" rather than uneven numbers. Reflect that in the extension version check. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1456 --- js/misc/extensionUtils.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/js/misc/extensionUtils.js b/js/misc/extensionUtils.js index e9697d468..128fc07d0 100644 --- a/js/misc/extensionUtils.js +++ b/js/misc/extensionUtils.js @@ -193,13 +193,11 @@ function versionCheck(required, current) { let currentArray = current.split('.'); let major = currentArray[0]; let minor = currentArray[1]; - let point = currentArray[2]; for (let i = 0; i < required.length; i++) { let requiredArray = required[i].split('.'); - if (requiredArray[0] == major && - requiredArray[1] == minor && - ((requiredArray[2] === undefined && parseInt(minor) % 2 == 0) || - requiredArray[2] == point)) + if (requiredArray[0] === major && + (requiredArray[1] === undefined && isFinite(minor) || + requiredArray[1] === minor)) return true; } return false;