v10.2.5
This commit is contained in:
parent
94cf96a0e5
commit
e39d4fa370
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-update",
|
||||
"version": "10.2.4",
|
||||
"version": "10.2.5",
|
||||
"description": "react-native hot update",
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
@ -68,9 +68,9 @@
|
||||
"detox": "^20.5.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-ft-flow": "^3.0.7",
|
||||
"jest": "^29.7.0",
|
||||
"firebase-tools": "^11.24.1",
|
||||
"fs-extra": "^9.1.0",
|
||||
"jest": "^29.7.0",
|
||||
"pod-install": "^0.1.37",
|
||||
"prettier": "^2",
|
||||
"react": "18.2.0",
|
||||
|
@ -34,6 +34,7 @@ export const PushyProvider = ({
|
||||
const [updateInfo, setUpdateInfo] = useState<CheckResult>();
|
||||
const [progress, setProgress] = useState<ProgressData>();
|
||||
const [lastError, setLastError] = useState<Error>();
|
||||
const lastChecking = useRef(0);
|
||||
|
||||
const dismissError = useCallback(() => {
|
||||
setLastError(undefined);
|
||||
@ -102,6 +103,11 @@ export const PushyProvider = ({
|
||||
);
|
||||
|
||||
const checkUpdate = useCallback(async () => {
|
||||
const now = Date.now();
|
||||
if (lastChecking.current && now - lastChecking.current < 1000) {
|
||||
return;
|
||||
}
|
||||
lastChecking.current = now;
|
||||
let info: CheckResult;
|
||||
try {
|
||||
info = await client.checkUpdate();
|
||||
|
Loading…
Reference in New Issue
Block a user