react-native-update 10.11.1 → 10.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/client.ts +13 -8
- package/src/provider.tsx +2 -2
- package/src/type.ts +1 -0
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -293,7 +293,7 @@ export class Pushy {
|
|
|
293
293
|
},
|
|
294
294
|
);
|
|
295
295
|
}
|
|
296
|
-
let succeeded =
|
|
296
|
+
let succeeded = '';
|
|
297
297
|
this.report({ type: 'downloading' });
|
|
298
298
|
let lastError: any;
|
|
299
299
|
const diffUrl = (await testUrls(diffUrls)) || _diffUrl;
|
|
@@ -305,11 +305,11 @@ export class Pushy {
|
|
|
305
305
|
hash,
|
|
306
306
|
originHash: currentVersion,
|
|
307
307
|
});
|
|
308
|
-
succeeded =
|
|
308
|
+
succeeded = 'diff';
|
|
309
309
|
} catch (e: any) {
|
|
310
310
|
lastError = e;
|
|
311
311
|
if (__DEV__) {
|
|
312
|
-
succeeded =
|
|
312
|
+
succeeded = 'diff';
|
|
313
313
|
} else {
|
|
314
314
|
log(`diff error: ${e.message}, try pdiff`);
|
|
315
315
|
}
|
|
@@ -323,11 +323,11 @@ export class Pushy {
|
|
|
323
323
|
updateUrl: pdiffUrl,
|
|
324
324
|
hash,
|
|
325
325
|
});
|
|
326
|
-
succeeded =
|
|
326
|
+
succeeded = 'pdiff';
|
|
327
327
|
} catch (e: any) {
|
|
328
328
|
lastError = e;
|
|
329
329
|
if (__DEV__) {
|
|
330
|
-
succeeded =
|
|
330
|
+
succeeded = 'pdiff';
|
|
331
331
|
} else {
|
|
332
332
|
log(`pdiff error: ${e.message}, try full patch`);
|
|
333
333
|
}
|
|
@@ -341,11 +341,11 @@ export class Pushy {
|
|
|
341
341
|
updateUrl: updateUrl,
|
|
342
342
|
hash,
|
|
343
343
|
});
|
|
344
|
-
succeeded =
|
|
344
|
+
succeeded = 'full';
|
|
345
345
|
} catch (e: any) {
|
|
346
346
|
lastError = e;
|
|
347
347
|
if (__DEV__) {
|
|
348
|
-
succeeded =
|
|
348
|
+
succeeded = 'full';
|
|
349
349
|
} else {
|
|
350
350
|
log(`full patch error: ${e.message}`);
|
|
351
351
|
}
|
|
@@ -367,8 +367,13 @@ export class Pushy {
|
|
|
367
367
|
throw lastError;
|
|
368
368
|
}
|
|
369
369
|
return;
|
|
370
|
+
} else {
|
|
371
|
+
this.report({
|
|
372
|
+
type: 'downloadSuccess',
|
|
373
|
+
data: { newVersion: hash, diff: succeeded },
|
|
374
|
+
});
|
|
370
375
|
}
|
|
371
|
-
log(
|
|
376
|
+
log(`downloaded ${succeeded} hash:`, hash);
|
|
372
377
|
setLocalHashInfo(hash, {
|
|
373
378
|
name,
|
|
374
379
|
description,
|
package/src/provider.tsx
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from './core';
|
|
22
22
|
import { CheckResult, ProgressData, PushyTestPayload } from './type';
|
|
23
23
|
import { PushyContext } from './context';
|
|
24
|
-
import {
|
|
24
|
+
import { URL } from 'react-native-url-polyfill';
|
|
25
25
|
|
|
26
26
|
export const PushyProvider = ({
|
|
27
27
|
client,
|
|
@@ -307,7 +307,7 @@ export const PushyProvider = ({
|
|
|
307
307
|
if (!url) {
|
|
308
308
|
return;
|
|
309
309
|
}
|
|
310
|
-
const params = new
|
|
310
|
+
const params = new URL(url).searchParams;
|
|
311
311
|
const payload = {
|
|
312
312
|
type: params.get('type'),
|
|
313
313
|
data: params.get('data'),
|