Fix incorrect selection of counties #247
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.
What does it fix?
Closes #246
Fixes the bug with incorrect selection of the county when there's no internet.
This was happening due to the order of the counties. When there is internet the repository returns the counties returned by the API call which are sorted, when there is no internet the repository returns the counties from the database which are not sorted. The app then tries to select a county based on a sorted/unsorted list of counties which is problematic because we have a county("București") which jumps positions so any county between 0 and the position of "București" gets offset by one.
How has it been tested?
Tested against the steps mentioned in the issue.