Explicit type conversion in version number comparison.

This commit is contained in:
Xaekai 2017-11-27 23:56:21 -08:00
parent aa5066762b
commit 6a0608bf7e
1 changed files with 5 additions and 1 deletions

View File

@ -3247,11 +3247,15 @@ function maybePromptToUpgradeUserscript() {
return;
}
var currentVersion = GS_VERSION.toString().split('.'); // data.js
var currentVersion = GS_VERSION.toString(); // data.js
var userscriptVersion = window.driveUserscriptVersion;
if (!userscriptVersion) {
userscriptVersion = '1.0';
}
currentVersion = currentVersion.split('.').map(function (part) {
return parseInt(part, 10);
});
userscriptVersion = userscriptVersion.split('.').map(function (part) {
return parseInt(part, 10);
});