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

fix type error

This commit is contained in:
sunnylqm
2025-04-11 18:23:38 +08:00
parent 4a7bb19ca1
commit bf3a0808f6
2 changed files with 3 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ const defaultClientOptions: ClientOptions = {
throwError: false,
};
const sharedState: {
export const sharedState: {
progressHandlers: Record<string, EmitterSubscription>;
downloadedHash?: string;
apkStatus: 'downloading' | 'downloaded' | null;

View File

@@ -12,7 +12,7 @@ import {
Platform,
Linking,
} from 'react-native';
import { Pushy, Cresc } from './client';
import { Pushy, Cresc, sharedState } from './client';
import { currentVersion, packageVersion, getCurrentVersionInfo } from './core';
import { CheckResult, ProgressData, UpdateTestPayload } from './type';
import { UpdateContext } from './context';
@@ -190,7 +190,7 @@ export const UpdateProvider = ({
return;
}
const { downloadUrl } = info;
if (downloadUrl && Pushy.apkStatus === null) {
if (downloadUrl && sharedState.apkStatus === null) {
if (options.updateStrategy === 'silentAndNow') {
if (Platform.OS === 'android' && downloadUrl.endsWith('.apk')) {
downloadAndInstallApk(downloadUrl);