From fdcbcc159b36f5eb708e84a3d2904faf732fc6f8 Mon Sep 17 00:00:00 2001 From: Angad <80452785+Angad-Godara@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:45:08 +0530 Subject: [PATCH] minor bug fixes --- package.json | 4 ++-- public/meta.json | 1 + src/Hooks/useCacheBuster.js | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 public/meta.json diff --git a/package.json b/package.json index 11651e0..313af48 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ "scripts": { "start": "react-scripts start", "prebuild": "node ./build-version", - "build": "set \"GENERATE_SOURCEMAP=false\" && set \"REACT_APP_VERSION=$npm_package_version\" && react-scripts build", - "host": "CI=false GENERATE_SOURCEMAP=false REACT_APP_VERSION=$npm_package_version npm run prebuild && react-scripts build", + "build": "set \"GENERATE_SOURCEMAP=false\" && set \"REACT_APP_VERSION=$npm_package_version\" && npm run prebuild && react-scripts build", + "host": "CI=false GENERATE_SOURCEMAP=false REACT_APP_VERSION=$npm_package_version react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, diff --git a/public/meta.json b/public/meta.json new file mode 100644 index 0000000..ac547bf --- /dev/null +++ b/public/meta.json @@ -0,0 +1 @@ +{"version":"0.2.4"} \ No newline at end of file diff --git a/src/Hooks/useCacheBuster.js b/src/Hooks/useCacheBuster.js index eaf5738..83ddb96 100644 --- a/src/Hooks/useCacheBuster.js +++ b/src/Hooks/useCacheBuster.js @@ -2,6 +2,7 @@ import { useEffect } from 'react'; import { useLocation } from 'react-router-dom'; const useCacheBuster = () => { + console.log("cache----buster") const location = useLocation(); const parseVersion = (str) => +str.replace(/\D/g, ''); const version = process.env.REACT_APP_VERSION; @@ -14,8 +15,9 @@ const useCacheBuster = () => { const metaVersion = parseVersion(meta.version); const packageVersion = parseVersion(version); if (packageVersion < metaVersion) { + console.log(packageVersion, metaVersion) if (window?.location?.reload) { - window.location.reload(); + // window.location.reload(); } } }