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)
|
tainacan.get(endpoint)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
|
||||||
for (let item of response.data) {
|
for (let item of response.data) {
|
||||||
modalItems.push({
|
modalItems.push({
|
||||||
title: item.title,
|
title: item.title,
|
||||||
|
@ -644,14 +643,16 @@ registerBlockType('tainacan/items-list', {
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetCollections() {
|
function resetCollections() {
|
||||||
|
itemsPage = 1;
|
||||||
collectionId = null;
|
collectionId = null;
|
||||||
collectionPage = 1;
|
collectionPage = 1;
|
||||||
modalItems = [];
|
modalItems = [];
|
||||||
|
|
||||||
setAttributes({
|
setAttributes({
|
||||||
|
itemsPage: itemsPage,
|
||||||
collectionId: collectionId,
|
collectionId: collectionId,
|
||||||
collectionPage: collectionPage,
|
collectionPage: collectionPage,
|
||||||
modalItems: false
|
modalItems: modalItems
|
||||||
});
|
});
|
||||||
fetchModalCollections();
|
fetchModalCollections();
|
||||||
}
|
}
|
||||||
|
|
|
@ -594,10 +594,12 @@ registerBlockType('tainacan/terms-list', {
|
||||||
function resetTaxonomies() {
|
function resetTaxonomies() {
|
||||||
taxonomyId = null;
|
taxonomyId = null;
|
||||||
taxonomyPage = 1;
|
taxonomyPage = 1;
|
||||||
|
modalTaxonomies = [];
|
||||||
|
|
||||||
setAttributes({
|
setAttributes({
|
||||||
taxonomyId: taxonomyId,
|
taxonomyId: taxonomyId,
|
||||||
taxonomyPage: taxonomyPage
|
taxonomyPage: taxonomyPage,
|
||||||
|
modalTaxonomies: modalTaxonomies
|
||||||
});
|
});
|
||||||
fetchModalTaxonomies();
|
fetchModalTaxonomies();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue