From ff1c7207c4a69e5af932dc77e023b712967ce857 Mon Sep 17 00:00:00 2001 From: aiooss-anssi Date: Wed, 31 Jul 2024 16:41:35 +0200 Subject: [PATCH] webapp/flowlist: show loading indicator sooner --- webapp/static/js/flowlist.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/webapp/static/js/flowlist.js b/webapp/static/js/flowlist.js index e370f42..353a575 100644 --- a/webapp/static/js/flowlist.js +++ b/webapp/static/js/flowlist.js @@ -456,6 +456,13 @@ class FlowList { document.getElementById('filter-time-until').value = toTick } document.getElementById('filter-time-until').classList.toggle('is-active', toTs) + + // Empty flow list + const flowList = document.getElementById('flow-list') + while (flowList.lastChild) { + flowList.removeChild(flowList.lastChild) + } + this.lastTick = -1 } // Fetch API and update @@ -470,14 +477,7 @@ class FlowList { ) await this.updateProtocolFilter(appProto) this.updateTagFilter(tags, filterTagsRequire, filterTagsDeny) - if (!fillTo) { - // Empty flow list - const flowList = document.getElementById('flow-list') - while (flowList.lastChild) { - flowList.removeChild(flowList.lastChild) - } - this.lastTick = -1 - } else { + if (fillTo) { // Pop the first element as it is already present flows.shift() }