mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-16 07:01:38 +08:00
fix type error
This commit is contained in:
@@ -61,7 +61,7 @@ const defaultClientOptions: ClientOptions = {
|
||||
throwError: false,
|
||||
};
|
||||
|
||||
const sharedState: {
|
||||
export const sharedState: {
|
||||
progressHandlers: Record<string, EmitterSubscription>;
|
||||
downloadedHash?: string;
|
||||
apkStatus: 'downloading' | 'downloaded' | null;
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user