mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-02 06:13:11 +08:00
fix: switchVersion after switchVersionLater
This commit is contained in:
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user