@secretstache/wordpress-gutenberg 0.6.10 → 0.6.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.6.10",
3
+ "version": "0.6.11",
4
4
  "description": "",
5
5
  "author": "Secret Stache",
6
6
  "license": "GPL-2.0-or-later",
@@ -10,7 +10,7 @@ import { arrayMove } from 'react-sortable-hoc';
10
10
  import Select from 'react-select';
11
11
 
12
12
  import { SortableSelectAsync } from './SortableSelect.jsx';
13
- import { decodeHtmlEntities, loadSelectOptions } from '../utils/index.js';
13
+ import { decodeHtmlEntities, loadSelectOptions, useDefaultSelectOptions } from '../utils/index.js';
14
14
 
15
15
  const DataQueryContext = createContext({});
16
16
 
@@ -192,11 +192,7 @@ const CuratedPosts = memo(({
192
192
  return await loadSelectOptions(inputValue, postType);
193
193
  }, []);
194
194
 
195
- const [ defaultPostsOptions, setDefaultPostsOptions ] = useState([]);
196
-
197
- useEffect(() => {
198
- loadSelectOptions('', postType).then(setDefaultPostsOptions);
199
- }, []);
195
+ const { options: defaultPostsOptions } = useDefaultSelectOptions(postType);
200
196
 
201
197
  const onSortEnd = useCallback(({ oldIndex, newIndex }) => {
202
198
  const newCuratedPosts = arrayMove(curatedPosts, oldIndex, newIndex);