-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Fix infinite category loading state #40073
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi , @woocommerce/mothra Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
Test Results SummaryCommit SHA: 906bdbc
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix!
setIsSearching( false ); | ||
} catch ( e ) { | ||
setIsSearching( false ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works. One possible alternative would be to put it in a finally
block and change the catch
to show an alert that an error occurred...
} finally {
setIsSearching( false );
}
But, I'm okay with keeping things exactly as you have them for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call! I changed that in the commit 906bdbc
Submission Review Guidelines:
Changes proposed in this Pull Request:
After merging this PR (which sends the
isLoading
prop to the SelectTreeMenu) and this PR, the category selector underProducts > Add New > Organization
never loses theloading
state.The problem is that the hook
useTaxonomySearch
never sets the isLoading state to false after fetching.This PR fixes the problem.
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Organization
and select the Categories dropdown menu.Changelog entry
Significance
Type
Message
Comment