mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-03 14:53:10 +08:00
Update react-native-update to version 10.32.0 in package.json, refactor error handling in DownloadTask and UpdateContext for improved readability, and enhance type definitions in various files for better TypeScript support.
This commit is contained in:
@@ -16,9 +16,9 @@ import { Pushy, Cresc, sharedState } from './client';
|
||||
import { currentVersion, packageVersion, getCurrentVersionInfo, currentVersionInfo } from './core';
|
||||
import {
|
||||
CheckResult,
|
||||
MixedCheckResult,
|
||||
ProgressData,
|
||||
UpdateTestPayload,
|
||||
VersionInfo,
|
||||
} from './type';
|
||||
import { UpdateContext } from './context';
|
||||
import { URL } from 'react-native-url-polyfill';
|
||||
@@ -163,7 +163,7 @@ export const UpdateProvider = ({
|
||||
return;
|
||||
}
|
||||
lastChecking.current = now;
|
||||
let rootInfo: MixedCheckResult | undefined;
|
||||
let rootInfo: CheckResult | undefined;
|
||||
try {
|
||||
rootInfo = await client.checkUpdate(extra);
|
||||
} catch (e: any) {
|
||||
@@ -175,8 +175,8 @@ export const UpdateProvider = ({
|
||||
if (!rootInfo) {
|
||||
return;
|
||||
}
|
||||
const versions = rootInfo.versions || [rootInfo as CheckResult];
|
||||
delete rootInfo.versions;
|
||||
const versions = [rootInfo.expVersion, rootInfo].filter(Boolean) as VersionInfo[];
|
||||
delete rootInfo.expVersion;
|
||||
for (const versionInfo of versions) {
|
||||
const info: CheckResult = {
|
||||
...versionInfo,
|
||||
@@ -242,7 +242,7 @@ export const UpdateProvider = ({
|
||||
alertUpdate(
|
||||
client.t('alert_title'),
|
||||
client.t('alert_new_version_found', {
|
||||
name: info.name,
|
||||
name: info.name!,
|
||||
description: info.description,
|
||||
}),
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user