Patched gallery duplication on multi-image upload

Quick patch to clear the gallery display when getting the first page.
Duplication of the galler was occuring due to the mulitple upload events
loading the gallery mulitple times while only clearing the existing
gallery at the start of all refreshes.

A bit flashy in terms of user experience, as there will still be
mulitple load/clear events but fixes the duplication. Could be done more
elegently in future by communicating up image upload counts.

For #3160
This commit is contained in:
Dan Brown 2022-01-24 21:38:11 +00:00
parent 7b4086107c
commit 4aed3f8558
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -122,6 +122,9 @@ class ImageManager {
};
const {data: html} = await window.$http.get(`images/${this.type}`, params);
if (params.page === 1) {
this.listContainer.innerHTML = '';
}
this.addReturnedHtmlElementsToList(html);
removeLoading(this.listContainer);
}