Fixes wron assignment to modalItems after collection reset.
This commit is contained in:
parent
5129b17b07
commit
abec33df86
|
@ -615,7 +615,6 @@ registerBlockType('tainacan/items-list', {
|
|||
|
||||
tainacan.get(endpoint)
|
||||
.then(response => {
|
||||
|
||||
for (let item of response.data) {
|
||||
modalItems.push({
|
||||
title: item.title,
|
||||
|
@ -644,14 +643,16 @@ registerBlockType('tainacan/items-list', {
|
|||
}
|
||||
|
||||
function resetCollections() {
|
||||
itemsPage = 1;
|
||||
collectionId = null;
|
||||
collectionPage = 1;
|
||||
modalItems = [];
|
||||
|
||||
setAttributes({
|
||||
itemsPage: itemsPage,
|
||||
collectionId: collectionId,
|
||||
collectionPage: collectionPage,
|
||||
modalItems: false
|
||||
modalItems: modalItems
|
||||
});
|
||||
fetchModalCollections();
|
||||
}
|
||||
|
|
|
@ -594,10 +594,12 @@ registerBlockType('tainacan/terms-list', {
|
|||
function resetTaxonomies() {
|
||||
taxonomyId = null;
|
||||
taxonomyPage = 1;
|
||||
modalTaxonomies = [];
|
||||
|
||||
setAttributes({
|
||||
taxonomyId: taxonomyId,
|
||||
taxonomyPage: taxonomyPage
|
||||
taxonomyPage: taxonomyPage,
|
||||
modalTaxonomies: modalTaxonomies
|
||||
});
|
||||
fetchModalTaxonomies();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue