Workspace Settings page - Fix offline behavior #5893
Merged
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.
Previously, when clicking "Save" on the workspace settings page, we'd only update Onyx after the promise to the
UpdatePolicy
API command resolved. When this happened offline, the promise would never resolve, meaning we'd never updateisPolicyUpdating
for the policy in Onyx, leading to a confusing infinite spinner.Let's update the local values directly for the workspace and queue the API request in the background. This means that the local values will be updated while offline, and the queued API command will be made once the user goes back online.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/180965
Tests
QA Steps
Tested On
Screenshots
Web
web.mp4
Mobile Web
mweb.mov
Desktop
desktop.mp4
iOS
ios.mp4
Android
android.mp4