DBC22-5321: refresh my camera page to update camera data - #1178
Conversation
ray-oxd
left a comment
There was a problem hiding this comment.
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:
- find out why cameras is always null and fix it
- 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
0e515ec to
5ec496d
Compare
wmuldergov
left a comment
There was a problem hiding this comment.
Confirmed this works
No description provided.