mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-10-30 04:43:11 +08:00
add currentversioninfo
This commit is contained in:
16
src/core.ts
16
src/core.ts
@@ -30,6 +30,21 @@ const PushyConstants = isTurboModuleEnabled
|
||||
export const downloadRootDir: string = PushyConstants.downloadRootDir;
|
||||
export const packageVersion: string = PushyConstants.packageVersion;
|
||||
export const currentVersion: string = PushyConstants.currentVersion;
|
||||
|
||||
const currentVersionInfoString: string = PushyConstants.currentVersionInfo;
|
||||
let _currentVersionInfo = {};
|
||||
if (currentVersionInfoString) {
|
||||
try {
|
||||
_currentVersionInfo = JSON.parse(currentVersionInfoString);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
'Failed to parse currentVersionInfo:',
|
||||
currentVersionInfoString,
|
||||
);
|
||||
}
|
||||
}
|
||||
export const currentVersionInfo = _currentVersionInfo;
|
||||
|
||||
export const isFirstTime: boolean = PushyConstants.isFirstTime;
|
||||
export const rolledBackVersion: string = PushyConstants.rolledBackVersion;
|
||||
export const isRolledBack: boolean = typeof rolledBackVersion === 'string';
|
||||
@@ -45,6 +60,7 @@ async function getLocalHashInfo(hash: string) {
|
||||
return JSON.parse(await PushyModule.getLocalHashInfo(hash));
|
||||
}
|
||||
|
||||
// @deprecated use currentVersionInfo instead
|
||||
export async function getCurrentVersionInfo(): Promise<{
|
||||
name?: string;
|
||||
description?: string;
|
||||
|
||||
Reference in New Issue
Block a user