Skip to content

Commit

Permalink
fix: sipcapture/homer#625 used tsNs field for sorting of messages
Browse files Browse the repository at this point in the history
  • Loading branch information
RFbkak37y3kIY committed Jan 9, 2024
1 parent 84c9936 commit 1325ecf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/SimplePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,15 @@ function formattingDataAndSortIt(data: any, sortType = 'none') {
return unSortData;
}
const sortData = unSortData.sort((itemA: any, itemB: any) => {
const a = itemA.tsNs;
const b = itemB.tsNs;
return a < b ? -1 : a > b ? 1 : 0;
if (itemA.tsNs && itemB.tsNs) {
const a = itemA.tsNs;
const b = itemB.tsNs;
return a < b ? -1 : a > b ? 1 : 0;
} else {
const a = itemA.Time;
const b = itemB.Time;
return a < b ? -1 : a > b ? 1 : 0;
}
});
if (sortType === 'time_old') {
return sortData;
Expand Down

0 comments on commit 1325ecf

Please sign in to comment.