App: [Network] Language Picker on Login Page call the API unnecessarily & does not behave correctly
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
ISSUES
- Language Picker calls the API which is unnecessary and It blocks the network queue.
- Its theme does not match other inputs in the app. No border, etc.
- We have to select the two times to make language change take effect.

- We have to select the language two times to switch it.
Action Performed:
- Open the login page & sign in with some account.
- Sign out of the app.
- Switch a language.
- Check Console logs for seeing the blocked network queue.
Expected Result:
- No API calls should be made instead language should be set on Onyx only.
- The picker theme should match with the theme of other Pickers.
- It should work in the first change.
Actual Result:
- It blocks the queue and makes an unnecessary backend request.
- Styling does not match the app theme.
- We have to select the language two times to activate it.
Workaround:
None. UI issue
Platform:
Where is this issue occurring?
- Web
- iOS
- Android
- Desktop App
- Mobile Web
Version Number: 1.0.85.0 Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
Proposal
- Correct the Dropdown theme so that it shows the outline when opened.
- Block the API call when Language is selected. To do this we can add a prop offline to the LocalPicker which can then pass to https://github.com/Expensify/App/blob/8b10c1c1a0267eb66ef8fdc6e0049f9b101836a2/src/libs/actions/App.js#L38 to block the API call when offline is
true. - Or, based on the suggestion from Peter, we can simply check for the
currentUserAccountIDbefore making the API call as this is only present when the user is logined.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 24 (12 by maintainers)
ok i paid it (note: i put it up for 500 because you both reported and solved it).
Thanks for confirming and re-posing @parasharrajat - The job is yours! Please submit a PR when you have a chance 👍
Sure.
currentUserAccountIDwhere If this isundefineddon’t make the API call. https://github.com/Expensify/App/blob/8b10c1c1a0267eb66ef8fdc6e0049f9b101836a2/src/libs/actions/App.js#L38Or the request can be skipped simply because there would not be a
currentUserAccountID