fix: switchVersion after switchVersionLater
This commit is contained in:
parent
6d0a31d749
commit
55aaf4fa45
12
lib/main.js
12
lib/main.js
@ -181,11 +181,7 @@ export async function downloadUpdate(options, eventListeners) {
|
|||||||
}
|
}
|
||||||
if (downloadedHash === options.hash) {
|
if (downloadedHash === options.hash) {
|
||||||
logger(`duplicated downloaded hash ${downloadedHash}, ignored`);
|
logger(`duplicated downloaded hash ${downloadedHash}, ignored`);
|
||||||
return;
|
return downloadedHash;
|
||||||
}
|
|
||||||
if (readyHash) {
|
|
||||||
logger(`hash ${readyHash} applied. reboot first`);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (downloadingThrottling) {
|
if (downloadingThrottling) {
|
||||||
logger('repeated downloading, ignored');
|
logger('repeated downloading, ignored');
|
||||||
@ -261,7 +257,6 @@ export async function downloadUpdate(options, eventListeners) {
|
|||||||
return options.hash;
|
return options.hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
let readyHash;
|
|
||||||
function assertHash(hash) {
|
function assertHash(hash) {
|
||||||
if (!downloadedHash) {
|
if (!downloadedHash) {
|
||||||
logger(`no downloaded hash`);
|
logger(`no downloaded hash`);
|
||||||
@ -271,11 +266,6 @@ function assertHash(hash) {
|
|||||||
logger(`use downloaded hash ${downloadedHash} first`);
|
logger(`use downloaded hash ${downloadedHash} first`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (readyHash === hash) {
|
|
||||||
logger(`hash ${readyHash} already applied. reboot first.`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
readyHash = hash;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user