bcgov / citz-imb-wayfinder

CITZ IMB Capstone 2023 Wayfinder
Apache License 2.0
6 stars 2 forks source link

[WAYF-114] FEATURE** Initial Offline Functionality #114

Closed dallascrichmond closed 1 year ago

dallascrichmond commented 1 year ago

Pull Request Standards

Description

This PR includes the following proposed change(s):

-Added a server side check using the API Health endpoint to determine if the device is online or not -If App is online, new data is pulled from the API and saving it to local storage as well as saving the current location -If App in offline the data and current location is set from local storage -Refactored setAppData to take a boolean as a prop that determines is the app is online or not and proceeds accordingly -Updated the CalcDistance function to implement new currentLocation and added some error handling -Updated comments -Added some error handling to BCServies and locations views in case appData in localStorage gets deleted