mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
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:
parent
7b4086107c
commit
4aed3f8558
@ -122,6 +122,9 @@ class ImageManager {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const {data: html} = await window.$http.get(`images/${this.type}`, params);
|
const {data: html} = await window.$http.get(`images/${this.type}`, params);
|
||||||
|
if (params.page === 1) {
|
||||||
|
this.listContainer.innerHTML = '';
|
||||||
|
}
|
||||||
this.addReturnedHtmlElementsToList(html);
|
this.addReturnedHtmlElementsToList(html);
|
||||||
removeLoading(this.listContainer);
|
removeLoading(this.listContainer);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user