mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-10-07 22:45:15 +08:00
v9.2.2
This commit is contained in:
10
lib/main.ts
10
lib/main.ts
@@ -16,7 +16,7 @@ import {
|
||||
UpdateAvailableResult,
|
||||
UpdateEventsListener,
|
||||
} from './type';
|
||||
import { assertRelease, logger, testUrls } from './utils';
|
||||
import { assertRelease, logger, promiseAny, testUrls } from './utils';
|
||||
export { setCustomEndpoints };
|
||||
const {
|
||||
version: v,
|
||||
@@ -167,8 +167,8 @@ export async function checkUpdate(APPKEY: string) {
|
||||
const backupEndpoints = await updateBackupEndpoints();
|
||||
if (backupEndpoints) {
|
||||
try {
|
||||
resp = await Promise.race(
|
||||
backupEndpoints.map((endpoint) =>
|
||||
resp = await promiseAny(
|
||||
backupEndpoints.map(endpoint =>
|
||||
fetch(getCheckUrl(APPKEY, endpoint), fetchPayload),
|
||||
),
|
||||
);
|
||||
@@ -205,7 +205,7 @@ function checkOperation(
|
||||
if (!Array.isArray(op)) {
|
||||
return;
|
||||
}
|
||||
op.forEach((action) => {
|
||||
op.forEach(action => {
|
||||
if (action.type === 'block') {
|
||||
blockUpdate = {
|
||||
reason: action.reason,
|
||||
@@ -250,7 +250,7 @@ export async function downloadUpdate(
|
||||
const downloadCallback = eventListeners.onDownloadProgress;
|
||||
progressHandler = eventEmitter.addListener(
|
||||
'RCTPushyDownloadProgress',
|
||||
(progressData) => {
|
||||
progressData => {
|
||||
if (progressData.hash === options.hash) {
|
||||
downloadCallback(progressData);
|
||||
}
|
||||
|
Reference in New Issue
Block a user