feat: persist last searched city using localStorage #115#144
feat: persist last searched city using localStorage #115#144SHUBHAM2775 wants to merge 2 commits into
Conversation
|
@SHUBHAM2775 is attempting to deploy a commit to the aditya-ai00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @SHUBHAM2775, Thanks for the contribution. The localStorage persistence feature is a useful improvement for user experience and the implementation approach looks good overall. However, the PR is still showing a merge conflict in Please:
Also, please keep the scope focused only on the localStorage persistence enhancement for Issue #115. Once the PR becomes conflict-free and stable, I’ll review it again. Thanks! |
Fixed it @aditya-ai00 . Do check it |
What this PR does / why we need it:
Resolves the issue where the weather application resets to a blank/geolocation state every time the user refreshes the page. By utilizing
localStorage, the app now automatically remembers and fetches the last successfully searched city on page reload.Acceptance Criteria Met:
localStorageis safely updated only after a successful API fetch.localStorage) by safely falling back to the default geolocation logic without console errors.Changes Made:
script.jsto initialize the app by readinglastSearchedCityfromlocalStorage.localStorage.setIteminsidegetWeather(), specifically placed after error-handling checks to guarantee data validity.Closes #115