Skip to content

Commit

Permalink
DBC22-1469: temporarily disabled data caching
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-oxd committed Jan 10, 2024
1 parent 84f9ef9 commit 7cc3766
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 25 deletions.
1 change: 1 addition & 0 deletions src/frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ module.exports = {
}],
"react/prop-types": "off",
'camelcase': 'off',
'no-unused-vars': 'off',
},
};
10 changes: 0 additions & 10 deletions src/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"react-scripts": "5.0.1",
"react-time-ago": "^7.2.1",
"redux-persist": "^6.0.0",
"redux-persist-expire": "^1.1.1",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions src/frontend/src/Components/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,12 @@ export default function MapWrapper({
const newRouteTimestamp = route ? route.searchTimestamp : null;

// Fetch data if it doesn't already exist or route was updated
if (!cameras || (camTimeStamp != newRouteTimestamp)) {
// if (!cameras || (camTimeStamp != newRouteTimestamp)) {
dispatch(updateCameras({
list: await getCameras(route ? route.points : null),
routeTimeStamp: route ? route.searchTimestamp : null,
}));
}
// }
}

useEffect(() => {
Expand All @@ -492,12 +492,12 @@ export default function MapWrapper({
const newRouteTimestamp = route ? route.searchTimestamp : null;

// Fetch data if it doesn't already exist or route was updated
if (!events || (eventTimeStamp != newRouteTimestamp)) {
// if (!events || (eventTimeStamp != newRouteTimestamp)) {
dispatch(updateEvents({
list: await getEvents(route ? route.points : null),
routeTimeStamp: route ? route.searchTimestamp : null,
}));
}
// }
}

useEffect(() => {
Expand All @@ -524,12 +524,12 @@ export default function MapWrapper({
const newRouteTimestamp = route ? route.searchTimestamp : null;

// Fetch data if it doesn't already exist or route was updated
if (!ferries || (ferriesTimeStamp != newRouteTimestamp)) {
// if (!ferries || (ferriesTimeStamp != newRouteTimestamp)) {
dispatch(updateFerries({
list: await getFerries(route ? route.points : null),
routeTimeStamp: route ? route.searchTimestamp : null,
}));
}
// }
}

const loadData = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/pages/AdvisoriesListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export default function AdvisoriesListPage() {

// Data loading
const loadAdvisories = async () => {
if (!advisories) {
// if (!advisories) {
dispatch(updateAdvisories(await getAdvisories()));
}
// }
}

useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/pages/BulletinsListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export default function BulletinsListPage() {

// Data loading
const loadBulletins = async () => {
if (!bulletins) {
// if (!bulletins) {
dispatch(updateBulletins(await getBulletins()));
}
// }
}

useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/pages/CamerasListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ export default function CamerasListPage() {

const newRouteTimestamp = selectedRoute ? selectedRoute.searchTimestamp : null;

if (!cameras || (camTimeStamp != newRouteTimestamp)) {
// if (!cameras || (camTimeStamp != newRouteTimestamp)) {
dispatch(updateCameras({
list: await getCameras(selectedRoute ? selectedRoute.points : null),
routeTimeStamp: selectedRoute ? selectedRoute.searchTimestamp : null,
}));
}
// }

// Deep clone and add group reference to each cam
const clonedCameras = JSON.parse(JSON.stringify(cameras));
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/pages/EventsListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ export default function EventsListPage() {
const newRouteTimestamp = route ? route.searchTimestamp : null;

// Fetch data if it doesn't already exist or route was updated
if (!events || (eventTimeStamp != newRouteTimestamp)) {
// if (!events || (eventTimeStamp != newRouteTimestamp)) {
dispatch(updateEvents({
list: await getEvents(route ? route.points : null),
routeTimeStamp: route ? route.searchTimestamp : null,
}));
}
// }
}

// Context
Expand Down

0 comments on commit 7cc3766

Please sign in to comment.