mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-10-07 22:25:14 +08:00
improve cleanup and rollout
This commit is contained in:
14
src/core.ts
14
src/core.ts
@@ -21,14 +21,14 @@ const PushyConstants = isTurboModuleEnabled
|
||||
? PushyModule.getConstants()
|
||||
: PushyModule;
|
||||
|
||||
export const downloadRootDir = PushyConstants.downloadRootDir;
|
||||
export const packageVersion = PushyConstants.packageVersion;
|
||||
export const currentVersion = PushyConstants.currentVersion;
|
||||
export const isFirstTime = PushyConstants.isFirstTime;
|
||||
export const rolledBackVersion = PushyConstants.rolledBackVersion;
|
||||
export const isRolledBack = typeof rolledBackVersion === 'string';
|
||||
export const downloadRootDir: string = PushyConstants.downloadRootDir;
|
||||
export const packageVersion: string = PushyConstants.packageVersion;
|
||||
export const currentVersion: string = PushyConstants.currentVersion;
|
||||
export const isFirstTime: boolean = PushyConstants.isFirstTime;
|
||||
export const rolledBackVersion: string = PushyConstants.rolledBackVersion;
|
||||
export const isRolledBack: boolean = typeof rolledBackVersion === 'string';
|
||||
|
||||
export const buildTime = PushyConstants.buildTime;
|
||||
export const buildTime: string = PushyConstants.buildTime;
|
||||
let uuid = PushyConstants.uuid;
|
||||
|
||||
if (Platform.OS === 'android' && !PushyConstants.isUsingBundleUrl) {
|
||||
|
@@ -166,7 +166,7 @@ export const PushyProvider = ({
|
||||
if (!info) {
|
||||
return;
|
||||
}
|
||||
const rollout = info.config?.rollout;
|
||||
const rollout = info.config?.rollout?.[packageVersion];
|
||||
if (rollout) {
|
||||
if (!isInRollout(rollout)) {
|
||||
log(`not in ${rollout}% rollout, ignored`);
|
||||
|
@@ -8,7 +8,9 @@ export interface CheckResult {
|
||||
description?: string;
|
||||
metaInfo?: string;
|
||||
config?: {
|
||||
rollout?: number;
|
||||
rollout?: {
|
||||
[packageVersion: string]: number;
|
||||
};
|
||||
[key: string]: any;
|
||||
};
|
||||
pdiff?: string;
|
||||
|
Reference in New Issue
Block a user