You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Right now on the Recently Views tab, the API Is called every time a user switched tabs, this will be taxing on the API. We can optimize this by calling the API once when the user first switches tabs then doing everything locally from there.
Another thing that is happening is that when the recently viewed are loading, the loading indicator is not displayed. The steps section has the fix on this.
It would also be nice to have a way to clear local storage via a button, that will wipe local storage of the jobIDS and also clear the array locally. For this button make sure to use the same style from the figma.
Acceptance Criteria
Recently Viewed Tab is optimized, where the API is only running once, and then all jobs are inserted locally. Follow the steps to ensure all bases are covered. Button is implemented in a nice spot on the page.
Steps:
The API call to get the recent jobs should only get called once when the user first clicks on the recently viewed tab. After this, all modifications to the local storage must also add the job to the array that displays the recent jobs. In order to add the jobs to the recent jobs array, we need to pass a setter function (function that adds a job to recent jobs) all the way down to the Job Card component. This setter function can be optional in the JobGrid, as some callers wont need it. This was the cleanest solution I thought of, feel free to investigate other/ your own idea for how to do this in a clean way.
Update the recent jobs to have a default value of null so the loader display while the API is running.
Implement a button to wipe local storage and jobs array. For this button, use a confirmation modal, the same one that the sign out is using in the nav bar.
The text was updated successfully, but these errors were encountered:
Description
Right now on the Recently Views tab, the API Is called every time a user switched tabs, this will be taxing on the API. We can optimize this by calling the API once when the user first switches tabs then doing everything locally from there.
Another thing that is happening is that when the recently viewed are loading, the loading indicator is not displayed. The steps section has the fix on this.
It would also be nice to have a way to clear local storage via a button, that will wipe local storage of the jobIDS and also clear the array locally. For this button make sure to use the same style from the figma.
Acceptance Criteria
Recently Viewed Tab is optimized, where the API is only running once, and then all jobs are inserted locally. Follow the steps to ensure all bases are covered. Button is implemented in a nice spot on the page.
Steps:
The text was updated successfully, but these errors were encountered: