mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-16 10:21:37 +08:00
v10.12.0
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-update",
|
"name": "react-native-update",
|
||||||
"version": "10.11.8",
|
"version": "10.12.0",
|
||||||
"description": "react-native hot update",
|
"description": "react-native hot update",
|
||||||
"main": "src/index",
|
"main": "src/index",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@@ -163,6 +163,13 @@ export class Pushy {
|
|||||||
console.warn('web 端不支持热更新检查');
|
console.warn('web 端不支持热更新检查');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
this.options.beforeCheckUpdate &&
|
||||||
|
(await this.options.beforeCheckUpdate()) === false
|
||||||
|
) {
|
||||||
|
log('beforeCheckUpdate 返回 false, 忽略检查');
|
||||||
|
return;
|
||||||
|
}
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
if (
|
if (
|
||||||
this.lastRespJson &&
|
this.lastRespJson &&
|
||||||
@@ -275,6 +282,13 @@ export class Pushy {
|
|||||||
description,
|
description,
|
||||||
metaInfo,
|
metaInfo,
|
||||||
} = info;
|
} = info;
|
||||||
|
if (
|
||||||
|
this.options.beforeDownloadUpdate &&
|
||||||
|
(await this.options.beforeDownloadUpdate(info)) === false
|
||||||
|
) {
|
||||||
|
log('beforeDownloadUpdate 返回 false, 忽略下载');
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!info.update || !hash) {
|
if (!info.update || !hash) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -81,6 +81,8 @@ export interface PushyOptions {
|
|||||||
dismissErrorAfter?: number;
|
dismissErrorAfter?: number;
|
||||||
debug?: boolean;
|
debug?: boolean;
|
||||||
throwError?: boolean;
|
throwError?: boolean;
|
||||||
|
beforeCheckUpdate?: () => Promise<boolean>;
|
||||||
|
beforeDownloadUpdate?: (info: CheckResult) => Promise<boolean>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PushyTestPayload {
|
export interface PushyTestPayload {
|
||||||
|
Reference in New Issue
Block a user