From cf782d26306c25a2f64abcd5bd77f1df0f614d92 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Thu, 19 Oct 2023 15:41:50 -0500 Subject: [PATCH] Fix `HistoryPanel` filter reactivity with deletions/undeletions --- .../History/CurrentHistory/HistoryPanel.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/client/src/components/History/CurrentHistory/HistoryPanel.vue b/client/src/components/History/CurrentHistory/HistoryPanel.vue index 37462b9bf3a0..fa981e021666 100644 --- a/client/src/components/History/CurrentHistory/HistoryPanel.vue +++ b/client/src/components/History/CurrentHistory/HistoryPanel.vue @@ -206,6 +206,7 @@ export default { operationRunning: null, operationError: null, querySelectionBreak: false, + itemsLoaded: [], }; }, computed: { @@ -234,10 +235,6 @@ export default { isProcessing() { return this.operationRunning >= this.history.update_time; }, - /** @returns {Array} */ - itemsLoaded() { - return this.getHistoryItems(this.historyId, this.filterText); - }, /** @returns {Date} */ lastChecked() { const { getLastCheckedTime } = storeToRefs(useHistoryItemsStore()); @@ -346,7 +343,6 @@ export default { try { await this.fetchHistoryItems(this.historyId, this.filterText, this.offset); this.searchError = null; - this.loading = false; } catch (error) { if (error.response && error.response.data && error.response.data.err_msg) { console.debug("HistoryPanel - Load items error:", error.response.data.err_msg); @@ -354,6 +350,15 @@ export default { } else { console.debug("HistoryPanel - Load items error.", error); } + } finally { + this.itemsLoaded = this.getHistoryItems(this.historyId, this.filterText); + if (this.invisible) { + this.itemsLoaded.forEach((item) => { + if (this.invisible[item.hid]) { + Vue.set(this.invisible, item.hid, false); + } + }); + } this.loading = false; } },