1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-16 10:51:38 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

feat: web mock

This commit is contained in:
sunnylqm
2022-11-23 18:23:48 +08:00
parent e0857d48ad
commit 6c1a4f148c
3 changed files with 19 additions and 2 deletions

17
lib/index.web.js Normal file
View File

@@ -0,0 +1,17 @@
export const downloadRootDir = '';
export const packageVersion = '';
export const currentVersion = '';
export const isFirstTime = false;
export const isRolledBack = false;
const noop = () => {};
export const checkUpdate = noop;
export const downloadUpdate = noop;
export const switchVersion = noop;
export const switchVersionLater = noop;
export const markSuccess = noop;
export const downloadAndInstallApk = noop;
export const setCustomEndpoints = noop;
export const getCurrentVersionInfo = noop;
export const simpleUpdate = noop;

View File

@@ -140,7 +140,7 @@ export async function checkUpdate(APPKEY, isRetry) {
if (isRetry) { if (isRetry) {
throw new Error('无法连接更新服务器,请检查网络连接后重试'); throw new Error('无法连接更新服务器,请检查网络连接后重试');
} }
await tryBackupEndpoints(APPKEY); await tryBackupEndpoints();
return checkUpdate(APPKEY, true); return checkUpdate(APPKEY, true);
} }
const result = await resp.json(); const result = await resp.json();

View File

@@ -1,6 +1,6 @@
{ {
"name": "react-native-update", "name": "react-native-update",
"version": "8.0.0", "version": "8.0.1",
"description": "react-native hot update", "description": "react-native hot update",
"main": "lib/index.js", "main": "lib/index.js",
"scripts": { "scripts": {