Skip to content

Commit

Permalink
minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Angad-Godara committed Nov 14, 2023
1 parent da5e750 commit fdcbcc1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
1 change: 1 addition & 0 deletions public/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"0.2.4"}
4 changes: 3 additions & 1 deletion src/Hooks/useCacheBuster.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
}
}
Expand Down

0 comments on commit fdcbcc1

Please sign in to comment.