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

fix: optimize

This commit is contained in:
steven
2023-02-19 21:14:03 +08:00
parent e859900df6
commit f8115c3a85
6 changed files with 383 additions and 34 deletions

View File

@@ -23,19 +23,20 @@ const Pushy = isTurboModuleEnabled ?
if (!Pushy) {
throw new Error('react-native-update模块无法加载请对照安装文档检查配置。');
}
const PushyConstants = isTurboModuleEnabled ? Pushy.getConstants(): Pushy;
export const downloadRootDir = isTurboModuleEnabled ? Pushy.getConstants().downloadRootDir : Pushy.downloadRootDir;
export const packageVersion = isTurboModuleEnabled ? Pushy.getConstants().packageVersion : Pushy.packageVersion;
export const currentVersion = isTurboModuleEnabled ? Pushy.getConstants().currentVersion : Pushy.currentVersion;
export const isFirstTime = isTurboModuleEnabled ? Pushy.getConstants().isFirstTime : Pushy.isFirstTime;
const rolledBackVersion = isTurboModuleEnabled ? Pushy.getConstants().rolledBackVersion : Pushy.rolledBackVersion;
export const downloadRootDir = PushyConstants.downloadRootDir;
export const packageVersion = PushyConstants.packageVersion;
export const currentVersion = PushyConstants.currentVersion;
export const isFirstTime = PushyConstants.isFirstTime;
const rolledBackVersion = PushyConstants.rolledBackVersion;
export const isRolledBack = typeof rolledBackVersion === 'string';
export const buildTime = isTurboModuleEnabled ? Pushy.getConstants().buildTime : Pushy.buildTime;
let blockUpdate = isTurboModuleEnabled ? Pushy.getConstants().blockUpdate : Pushy.blockUpdate;
let uuid = isTurboModuleEnabled ? Pushy.getConstants().uuid : Pushy.uuid;
export const buildTime = PushyConstants.buildTime;
let blockUpdate = PushyConstants.blockUpdate;
let uuid = PushyConstants.uuid;
if (Platform.OS === 'android' && !(isTurboModuleEnabled ? Pushy.getConstants().isUsingBundleUrl : Pushy.isUsingBundleUrl)) {
if (Platform.OS === 'android' && !PushyConstants.isUsingBundleUrl) {
throw new Error(
'react-native-update模块无法加载请对照文档检查Bundle URL的配置',
);