1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-16 08:41:37 +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, throwError: false,
}; };
const sharedState: { export const sharedState: {
progressHandlers: Record<string, EmitterSubscription>; progressHandlers: Record<string, EmitterSubscription>;
downloadedHash?: string; downloadedHash?: string;
apkStatus: 'downloading' | 'downloaded' | null; apkStatus: 'downloading' | 'downloaded' | null;

View File

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