v10.11.5
This commit is contained in:
parent
5e89fb4a25
commit
d666e8c0f3
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-update",
|
||||
"version": "10.11.4",
|
||||
"version": "10.11.5",
|
||||
"description": "react-native hot update",
|
||||
"main": "src/index",
|
||||
"scripts": {
|
||||
|
@ -172,7 +172,6 @@ export class Pushy {
|
||||
return await this.lastRespJson;
|
||||
}
|
||||
this.lastChecking = now;
|
||||
this.report({ type: 'checking' });
|
||||
const fetchBody = {
|
||||
packageVersion,
|
||||
hash: currentVersion,
|
||||
@ -183,16 +182,21 @@ export class Pushy {
|
||||
if (__DEV__) {
|
||||
delete fetchBody.buildTime;
|
||||
}
|
||||
const body = JSON.stringify(fetchBody);
|
||||
const fetchPayload = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(fetchBody),
|
||||
body,
|
||||
};
|
||||
let resp;
|
||||
try {
|
||||
this.report({
|
||||
type: 'checking',
|
||||
message: this.options.appKey + ': ' + body,
|
||||
});
|
||||
resp = await fetch(this.getCheckUrl(), fetchPayload);
|
||||
} catch (e: any) {
|
||||
this.report({
|
||||
@ -221,6 +225,8 @@ export class Pushy {
|
||||
|
||||
const result: CheckResult = await this.lastRespJson;
|
||||
|
||||
log('checking result:', result);
|
||||
|
||||
if (resp.status !== 200) {
|
||||
this.report({
|
||||
type: 'errorChecking',
|
||||
|
@ -290,10 +290,9 @@ export const PushyProvider = ({
|
||||
);
|
||||
|
||||
const parseTestQrCode = useCallback(
|
||||
(code: string) => {
|
||||
let payload: PushyTestPayload;
|
||||
(code: string | PushyTestPayload) => {
|
||||
try {
|
||||
payload = JSON.parse(code);
|
||||
const payload = typeof code === 'string' ? JSON.parse(code) : code;
|
||||
return parseTestPayload(payload);
|
||||
} catch {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user