Fix categories searching error when uploading photos #5878
Closed
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.
Description (required)
Fixes #5872
Adjustments to error handling logic:
Added the isInitialLoad status variable to track whether it was an initial load. This variable is set to true when the page starts loading and false for the first call to searchForCategories to ensure that no error messages are displayed during the initial loading.
Null input processing:
In the searchForCategories method, a check for whether the input is empty has been added. If the input is empty and the initial load is not categories_found, the call view.showError(r.sched.no_categories_found) shows an error.
EditText handling:
Ensure that edittext continues to receive input after ErrorShow is triggered, and that categories cannot be retrieved due to conflicts
Tests performed (required)
Tested Debug on Medium Phone with API level 34.