Skip to content

Commit

Permalink
webapp/flowlist: fix duplicate flow in infinite scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
aiooss-anssi committed Jul 31, 2024
1 parent 8bd20d2 commit 1f5f563
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webapp/static/js/flowlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class FlowList {
})

// Hide loading indicator if we are displaying less than 100 new flows
document.getElementById('flow-list-loading-indicator').classList.toggle('d-none', flows.length !== 100)
document.getElementById('flow-list-loading-indicator').classList.toggle('d-none', flows.length < 99)

// Refresh observer
// This trigger the observer again if the loading indicator is still intersecting with the viewport
Expand Down Expand Up @@ -477,6 +477,9 @@ class FlowList {
flowList.removeChild(flowList.lastChild)
}
this.lastTick = -1
} else {
// Pop the first element as it is already present
flows.shift()
}
await this.fillFlowsList(flows, tags)
this.updateActiveFlow(!fillTo)
Expand Down

0 comments on commit 1f5f563

Please sign in to comment.