-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Zoom out: add patterns loading state #61513
Conversation
select( coreStore ) | ||
); | ||
const patterns = getBlockPatternsForPostType( postType ); | ||
return isResolving( 'getBlockPatterns' ) ? undefined : patterns; |
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.
@jsnajdr This is a workaround to get the resolving state across stores. Not great, but it's a private setting for now. If it returns undefined, it means the data is still loading.
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.
Also even within the same store isResolving
on getBlockPatternsForPostType
doesn't work because it's not a resolver itself.
Anyway, curious if you have thoughts.
Size Change: -85 B (0%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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 looks great, thank you.
What?
Currently we don't have a loading state in the patterns inserter, it just shows "no results" while loading, because the selector returns an empty array.
Why?
It's misleading to say there are no results when in fact they just haven't loaded yet.
How?
Uses the
selectBlockPatternsKey
to determine the fetch status of patterns.Testing Instructions
Screenshots or screencast