From d1ecfb3f931d29552aae21531b576ac3632de782 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Thu, 18 Apr 2024 22:50:20 +0800 Subject: [PATCH] v10.4.1 --- package.json | 2 +- src/client.tsx | 7 +++++++ src/type.ts | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9be86fa..371831b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-update", - "version": "10.4.0", + "version": "10.4.1", "description": "react-native hot update", "main": "src/index.ts", "scripts": { diff --git a/src/client.tsx b/src/client.tsx index 1eb6d63..cb494eb 100644 --- a/src/client.tsx +++ b/src/client.tsx @@ -35,6 +35,7 @@ export class Pushy { useAlert: true, strategy: 'both', logger: noop, + debug: false, }; lastChecking?: number; @@ -146,6 +147,12 @@ export class Pushy { } }; checkUpdate = async () => { + if (__DEV__ && !this.options.debug) { + console.info( + '您当前处于开发环境且未启用debug,不会进行热更检查。如需在开发环境中调试热更,请在client中设置debug为true', + ); + return; + } const now = Date.now(); if ( this.lastRespJson && diff --git a/src/type.ts b/src/type.ts index 0fc79d0..fef845e 100644 --- a/src/type.ts +++ b/src/type.ts @@ -73,4 +73,5 @@ export interface PushyOptions { strategy?: 'onAppStart' | 'onAppResume' | 'both' | null; autoMarkSuccess?: boolean; dismissErrorAfter?: number; + debug?: boolean; }