Import versioning module just once.
This commit is contained in:
parent
91e3d25744
commit
64c317d862
|
@ -236,6 +236,9 @@ var LifeCycle = (() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const versioning = include("/nscl/common/Ver.js");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
async onInstalled(details) {
|
async onInstalled(details) {
|
||||||
if (!UA.isMozilla) {
|
if (!UA.isMozilla) {
|
||||||
|
@ -279,7 +282,7 @@ var LifeCycle = (() => {
|
||||||
|
|
||||||
if (!previousVersion) return;
|
if (!previousVersion) return;
|
||||||
|
|
||||||
await include("/nscl/common/Ver.js");
|
await versioning;
|
||||||
previousVersion = new Ver(previousVersion);
|
previousVersion = new Ver(previousVersion);
|
||||||
let currentVersion = new Ver(browser.runtime.getManifest().version);
|
let currentVersion = new Ver(browser.runtime.getManifest().version);
|
||||||
let upgrading = Ver.is(previousVersion, "<=", currentVersion);
|
let upgrading = Ver.is(previousVersion, "<=", currentVersion);
|
||||||
|
@ -364,7 +367,7 @@ var LifeCycle = (() => {
|
||||||
// user doesn't want us to remember temporary settings across updates: bail out
|
// user doesn't want us to remember temporary settings across updates: bail out
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await include("/nscl/common/Ver.js");
|
await versioning;
|
||||||
if (Ver.is(details.version, "<", browser.runtime.getManifest().version)) {
|
if (Ver.is(details.version, "<", browser.runtime.getManifest().version)) {
|
||||||
// downgrade: temporary survival might not be supported, and we don't care
|
// downgrade: temporary survival might not be supported, and we don't care
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue