react-native-update 9.0.1 → 9.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/main.ts +4 -2
- package/package.json +1 -1
package/lib/main.ts
CHANGED
|
@@ -132,12 +132,13 @@ function assertRelease() {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
let lastChecking = Date.now();
|
|
135
|
+
let lastResult:CheckResult;
|
|
135
136
|
export async function checkUpdate(APPKEY: string, isRetry?: boolean) {
|
|
136
137
|
assertRelease();
|
|
137
138
|
const now = Date.now();
|
|
138
|
-
if (now - lastChecking < 1000 *
|
|
139
|
+
if (lastResult && now - lastChecking < 1000 * 60) {
|
|
139
140
|
logger('repeated checking, ignored');
|
|
140
|
-
return;
|
|
141
|
+
return lastResult;
|
|
141
142
|
}
|
|
142
143
|
lastChecking = now;
|
|
143
144
|
if (blockUpdate && blockUpdate.until > Date.now() / 1000) {
|
|
@@ -177,6 +178,7 @@ export async function checkUpdate(APPKEY: string, isRetry?: boolean) {
|
|
|
177
178
|
return checkUpdate(APPKEY, true);
|
|
178
179
|
}
|
|
179
180
|
const result: CheckResult = await resp.json();
|
|
181
|
+
lastResult = result;
|
|
180
182
|
// @ts-ignore
|
|
181
183
|
checkOperation(result.op);
|
|
182
184
|
|