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.
cc @jasperhuangg
Details
There were a few issues here:
preferences
prop was not being providedOnyx.merge
instead ofOnyx.set
(not a problem per-se but weird for a value that's just a singular string)Onyx.merge
inline in a component callback instead of via an action.Picker
component is infuriating and triggers theonChange
callback multiple times.I'm not 100% sure what was causing the crash, but _after hooking up
preferredLocale
via Onyx, I was getting an infinite loop where:onChange
to update preferred locale in OnyxonChange
is triggered again (because thepreferredLocale
had changed), and this would restart the loop.Fixed Issues
Fixes #3606
Tests / QA Steps
Settings
->Preferences
, and toggle the preferred locale.Tested On
Screenshots
Web
Mobile Web
Desktop
iOS
Android