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