Fix: changes made to address book does not reflect in UI #747
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: jrw421 jessica.wolvington@gmail.com
Resolves #744
Impact: minor
Type: bugfix
Issue
Upon adding a new address or deleting an address the changes do not reflect immediately on UI. It only takes effect after browser refresh. The changes are persisted at DB level. Deleting a pre deleted address gives an appropriate address not found GraphQL error.
Steps to reproduce the behavior:
Solution
This was solved by adding a placeholder in the destructuring of the useViewer hook. It's possible that the hook was updated and the add/delete account files were not updated to reflect the change. The useViewer hook exports three items, the last of which was necessary to reflect the updates to the addresses (
refetchViewer
). Since the original code was only destructuring two items, therefetchViewer
was ultimately the wrong item and wasn't being called as expected.Note: The unused import is being destructured as an empty string to avoid
no-unused-var
linting issues. Happy to alter this if preferred.Breaking changes
None expected.
Testing