@secretstache/wordpress-gutenberg 0.5.10 → 0.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secretstache/wordpress-gutenberg",
3
- "version": "0.5.10",
3
+ "version": "0.5.11",
4
4
  "description": "",
5
5
  "author": "Secret Stache",
6
6
  "license": "GPL-2.0-or-later",
@@ -37,7 +37,6 @@ export const useDataQuery = (config, dependencies = []) => {
37
37
  const postsToShow = select('core').getEntityRecords('postType', preparedPostType, queryArgs);
38
38
  const isResolving = select('core/data').isResolving('core', 'getEntityRecords', ['postType', preparedPostType, queryArgs]);
39
39
 
40
- // TODO: use undefined to determine isEmpty
41
40
  const isEmpty = (postsToShow !== null && postsToShow?.length === 0) || numberOfPosts === 0;
42
41
 
43
42
  return {
@@ -20,6 +20,11 @@ export const useParentBlock = (
20
20
  return null;
21
21
  }
22
22
 
23
+ // Return the selected block if it already matches the target type
24
+ if (currentBlock?.name === parentBlockName) {
25
+ return currentBlock;
26
+ }
27
+
23
28
  // Get the list of parent blocks for the current block, from down to top
24
29
  const parentBlocks = getBlockParents(currentBlock.clientId, true);
25
30
 
@@ -29,11 +34,6 @@ export const useParentBlock = (
29
34
  return null;
30
35
  }
31
36
 
32
- // Return the selected block if it already matches the target type
33
- if (currentBlock?.name === parentBlockName) {
34
- return currentBlock;
35
- }
36
-
37
37
  if (parentBlocks?.length) {
38
38
  // Traverse the list of parent blocks to find the target parent block type
39
39
  for (let i = 0; i < parentBlocks.length; i++) {