1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-11-03 14:53:10 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

fix class properties

This commit is contained in:
sunnylqm
2025-02-23 17:26:59 +08:00
parent 3ccc3653ac
commit 4436654769
4 changed files with 57 additions and 40 deletions

View File

@@ -27,7 +27,9 @@ export const UpdateProvider = ({
client: Pushy | Cresc;
children: ReactNode;
}) => {
client = useRef(client).current;
const { options } = client;
const stateListener = useRef<NativeEventSubscription>();
const [updateInfo, setUpdateInfo] = useState<CheckResult>();
const updateInfoRef = useRef(updateInfo);
@@ -239,10 +241,7 @@ export const UpdateProvider = ({
const markSuccess = client.markSuccess;
useEffect(() => {
if (__DEV__ && !options.debug) {
console.info(
'您当前处于开发环境且未启用debug不会进行热更检查。如需在开发环境中调试热更请在client中设置debug为true',
);
if (!client.assertDebug()) {
return;
}
const { checkStrategy, dismissErrorAfter, autoMarkSuccess } = options;
@@ -272,7 +271,7 @@ export const UpdateProvider = ({
stateListener.current && stateListener.current.remove();
clearTimeout(dismissErrorTimer);
};
}, [checkUpdate, options, dismissError, markSuccess]);
}, [checkUpdate, options, dismissError, markSuccess, client]);
const parseTestPayload = useCallback(
(payload: UpdateTestPayload) => {