From 0cf53c5a5d45a9f883dc99f75c460ef81db5141b Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Tue, 29 Mar 2022 11:53:54 +0200 Subject: [PATCH] :beetle: Fix #118 (again) --- src/utils.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/utils.js b/src/utils.js index f1e5c8b..463dc83 100644 --- a/src/utils.js +++ b/src/utils.js @@ -15,10 +15,18 @@ const {Gtk} = imports.gi; -// Returns the given argument, except for "alpha" and "beta". In these cases -2 and -1 are -// returned respectively. +// Returns the given argument, except for "alpha", "beta", and "rc". In these cases -3, +// -2, and -1 are returned respectively. function toNumericVersion(x) { - return x == 'alpha' ? -2 : x == 'beta' ? -1 : x; + switch (x) { + case 'alpha': + return -3; + case 'beta': + return -2; + case 'rc': + return -1; + } + return x; } const Config = imports.misc.config;