Skip to content

Commit

Permalink
webapp/flowlist: remove duplicated flows
Browse files Browse the repository at this point in the history
  • Loading branch information
aiooss-anssi committed Aug 2, 2024
1 parent 2644e69 commit a8d77b9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions webapp/static/js/flowlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ class FlowList {
{ hour: 'numeric', minute: 'numeric', second: 'numeric', fractionalSecondDigits: 1 }
).format(date)

// Don't insert flow already in list
// This happens when adding flows during infinite scroll
if (flowList.querySelector(`a[data-flow="${flow.id}"]`)) {
return
}

// Create tick element on new tick
if (this.tickLength > 0) {
const tick = Math.floor((flow.ts_start / 1000 - this.startTs) / this.tickLength)
Expand Down Expand Up @@ -486,10 +492,6 @@ class FlowList {
this.tags = tags
await this.updateProtocolFilter(appProto)
this.updateTagFilter(tags, filterTagsRequire, filterTagsDeny)
if (fillTo) {
// 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 a8d77b9

Please sign in to comment.