Skip to content

Commit

Permalink
better names for per user speed popup
Browse files Browse the repository at this point in the history
  • Loading branch information
LoV432 committed Feb 16, 2024
1 parent b6350f6 commit 7ac1427
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,15 @@ function PerUserSpeedDetailsPopUp({
</>
);
const ipToName = allSpeeds[0].map((user) => {
const name = allUsers.filter((u) => u.ip === user.ip)[0];
if (!name) return;
const userDetails = allUsers.filter((u) => u.ip === user.ip)[0];
if (!userDetails) return;
if (Number(user.in) <= 0 && Number(user.out) <= 0) return;
let userName =
userDetails.display_name ||
(userDetails.name != 'Unknown' ? userDetails.name : user.ip);
return {
index_number: name.index_number,
name: name.name == 'Unknown' ? name.display_name : name.name,
index_number: userDetails.index_number,
name: userName,
in: user.in,
out: user.out
};
Expand Down

0 comments on commit 7ac1427

Please sign in to comment.