1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-11-02 06:13:11 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
sunnylqm
2024-08-24 15:28:27 +08:00
parent 5659c79726
commit d000c40e0f
3 changed files with 17 additions and 1 deletions

View File

@@ -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;
}