react-native-update 9.0.3 → 9.0.5

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.
@@ -1,2 +1,3 @@
1
1
  -keepnames class cn.reactnative.modules.update.DownloadTask { *; }
2
+ -keepnames class cn.reactnative.modules.update.UpdateModuleImpl { *; }
2
3
  -keepnames class com.facebook.react.ReactInstanceManager { *; }
@@ -1 +1 @@
1
- 1693625865
1
+ 1680488830
package/lib/main.ts CHANGED
@@ -131,12 +131,13 @@ function assertRelease() {
131
131
  }
132
132
  }
133
133
 
134
- let lastChecking = Date.now();
135
- let lastResult: CheckResult = {};
134
+ let lastChecking;
135
+ const empty = {};
136
+ let lastResult: CheckResult;
136
137
  export async function checkUpdate(APPKEY: string, isRetry?: boolean) {
137
138
  assertRelease();
138
139
  const now = Date.now();
139
- if (lastResult && now - lastChecking < 1000 * 60) {
140
+ if (lastResult && lastChecking && now - lastChecking < 1000 * 60) {
140
141
  // logger('repeated checking, ignored');
141
142
  return lastResult;
142
143
  }
@@ -148,7 +149,7 @@ export async function checkUpdate(APPKEY: string, isRetry?: boolean) {
148
149
  blockUpdate.until * 1000,
149
150
  ).toLocaleString()}"之后重试。`,
150
151
  });
151
- return lastResult;
152
+ return lastResult || empty;
152
153
  }
153
154
  report({ type: 'checking' });
154
155
  let resp;
@@ -172,7 +173,7 @@ export async function checkUpdate(APPKEY: string, isRetry?: boolean) {
172
173
  type: 'errorChecking',
173
174
  message: '无法连接更新服务器,请检查网络连接后重试',
174
175
  });
175
- return lastResult;
176
+ return lastResult || empty;
176
177
  }
177
178
  await tryBackupEndpoints();
178
179
  return checkUpdate(APPKEY, true);
@@ -189,7 +190,6 @@ export async function checkUpdate(APPKEY: string, isRetry?: boolean) {
189
190
  //@ts-ignore
190
191
  message: result.message,
191
192
  });
192
- return lastResult;
193
193
  }
194
194
 
195
195
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "9.0.3",
3
+ "version": "9.0.5",
4
4
  "description": "react-native hot update",
5
5
  "main": "lib/index.ts",
6
6
  "scripts": {