From 4aed3f8558c429d95bdc8a987d72a6a9f6df7267 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Mon, 24 Jan 2022 21:38:11 +0000 Subject: [PATCH] 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 --- resources/js/components/image-manager.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/js/components/image-manager.js b/resources/js/components/image-manager.js index 6d05d3388..23a6c4cbb 100644 --- a/resources/js/components/image-manager.js +++ b/resources/js/components/image-manager.js @@ -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); }