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.
Files changed (2) hide show
  1. package/lib/main.ts +4 -2
  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 * 5) {
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "9.0.1",
3
+ "version": "9.0.2",
4
4
  "description": "react-native hot update",
5
5
  "main": "lib/index.ts",
6
6
  "scripts": {