mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-16 08:41:37 +08:00
fix type error
This commit is contained in:
@@ -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;
|
||||||
|
@@ -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);
|
||||||
|
Reference in New Issue
Block a user