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.
- package/android/proguard.pro +1 -0
- package/ios/pushy_build_time.txt +1 -1
- package/lib/main.ts +6 -6
- package/package.json +1 -1
package/android/proguard.pro
CHANGED
package/ios/pushy_build_time.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1680488830
|
package/lib/main.ts
CHANGED
|
@@ -131,12 +131,13 @@ function assertRelease() {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
let lastChecking
|
|
135
|
-
|
|
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;
|