Skip to content

Commit b5ef2d0

Browse files
committed
code review for gorhill@0322d03303cd -- fix handling of rc versions
1 parent 0322d03 commit b5ef2d0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/js/start.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ var onVersionReady = function(lastVersion) {
144144
} else if ( pstr.startsWith('.') || pstr.startsWith('b') ) {
145145
pint = parseInt(pstr.slice(1), 10);
146146
} else if ( pstr.startsWith('rc') ) {
147-
pint = parseInt(pstr.slice(2), 10) * 100;
147+
pint = parseInt(pstr.slice(2), 10) + 100;
148148
} else {
149149
pint = parseInt(pstr, 10);
150150
}
@@ -153,14 +153,16 @@ var onVersionReady = function(lastVersion) {
153153
return vint;
154154
};
155155

156-
if ( intFromVersion(lastVersion) <= 1016021007 ) {
156+
let lastVersionInt = intFromVersion(lastVersion);
157+
158+
if ( lastVersionInt <= 1016021007 ) {
157159
µb.sessionSwitches.toggle('no-scripting', 'behind-the-scene', 2);
158160
µb.permanentSwitches.toggle('no-scripting', 'behind-the-scene', 2);
159161
µb.saveHostnameSwitches();
160162
}
161163

162164
// https://github.com/uBlockOrigin/uBlock-issues/issues/212#issuecomment-419741324
163-
if ( intFromVersion(lastVersion) <= 1015024000 ) {
165+
if ( lastVersionInt <= 1015024000 ) {
164166
if ( µb.hiddenSettings.manualUpdateAssetFetchPeriod === 2000 ) {
165167
µb.hiddenSettings.manualUpdateAssetFetchPeriod = 500;
166168
µb.saveHiddenSettings();

0 commit comments

Comments
 (0)