Skip to content

DBC22-5321: refresh my camera page to update camera data - #1178

Merged
wmuldergov merged 1 commit into
mainfrom
bugfix/DBC22-5321
Apr 21, 2026
Merged

DBC22-5321: refresh my camera page to update camera data#1178
wmuldergov merged 1 commit into
mainfrom
bugfix/DBC22-5321

Conversation

@bcgov-brwang

Copy link
Copy Markdown
Collaborator

No description provided.

@bcgov-brwang
bcgov-brwang requested a review from ray-oxd January 15, 2026 22:13
Comment thread src/frontend/src/pages/SavedCamerasPage.js

@ray-oxd ray-oxd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is something wrong on this page - cameras is always null even when stored properly in redux on other pages. If it's working properly,

const camData = cameras ? cameras : await getCameras().catch((error) => displayError(error));

this line will NOT update this page if we reuse exisiting data from redux all the time.

Please:

  1. find out why cameras is always null and fix it
  2. modify getSavedCameras to always make a fresh call on polling

@bcgov-brwang

Copy link
Copy Markdown
Collaborator Author

there is something wrong on this page - cameras is always null even when stored properly in redux on other pages. If it's working properly,

const camData = cameras ? cameras : await getCameras().catch((error) => displayError(error));

this line will NOT update this page if we reuse exisiting data from redux all the time.

Please:

  1. find out why cameras is always null and fix it
  2. modify getSavedCameras to always make a fresh call on polling

The null cameras issue was caused by the line of "return config.expiredState;" in the expireReducer.js, all the logic in the transformRehydrate was commented out, which makes the list and filtered list become null.

The solution we can do is to get rid of the cameras in SavedCameras, and do a fresh api call in getSavedCameras to make sure the camera list is the latest.

I tried to return outboundState in exipireReducer.js, and the cameras passed in SavedCameras won't be null then, but still needs to make a fresh api call to get the favCams refreshed, so I'm thinking probably we don't have to pass in the cameras and just make the api call each time when getSavedCamers was fired.

DBC22-5321: used PollingComponent to refresh on my camera page

DBC22-5321: removed passed in cameras and make fresh call to get latest camera list

@wmuldergov wmuldergov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed this works

@wmuldergov
wmuldergov merged commit 26d18bf into main Apr 21, 2026
9 of 10 checks passed
@wmuldergov
wmuldergov deleted the bugfix/DBC22-5321 branch April 21, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants