Skip to content

Commit bf3a080

Browse files
committed
fix type error
1 parent 4a7bb19 commit bf3a080

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const defaultClientOptions: ClientOptions = {
6161
throwError: false,
6262
};
6363

64-
const sharedState: {
64+
export const sharedState: {
6565
progressHandlers: Record<string, EmitterSubscription>;
6666
downloadedHash?: string;
6767
apkStatus: 'downloading' | 'downloaded' | null;

src/provider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
Platform,
1313
Linking,
1414
} from 'react-native';
15-
import { Pushy, Cresc } from './client';
15+
import { Pushy, Cresc, sharedState } from './client';
1616
import { currentVersion, packageVersion, getCurrentVersionInfo } from './core';
1717
import { CheckResult, ProgressData, UpdateTestPayload } from './type';
1818
import { UpdateContext } from './context';
@@ -190,7 +190,7 @@ export const UpdateProvider = ({
190190
return;
191191
}
192192
const { downloadUrl } = info;
193-
if (downloadUrl && Pushy.apkStatus === null) {
193+
if (downloadUrl && sharedState.apkStatus === null) {
194194
if (options.updateStrategy === 'silentAndNow') {
195195
if (Platform.OS === 'android' && downloadUrl.endsWith('.apk')) {
196196
downloadAndInstallApk(downloadUrl);

0 commit comments

Comments
 (0)