mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Tooltip: Spiffier 4 users list (#6730)
This commit is contained in:
parent
c42b9e550a
commit
1c1bec12d2
1 changed files with 10 additions and 5 deletions
|
|
@ -81,11 +81,16 @@ const condenseDeviceUsers = (users: IDeviceUser[]): string[] => {
|
|||
return [];
|
||||
}
|
||||
const condensed =
|
||||
users
|
||||
.slice(-3)
|
||||
.map((u) => u.email)
|
||||
.reverse() || [];
|
||||
return users.length > 3
|
||||
users.length === 4
|
||||
? users
|
||||
.slice(-4)
|
||||
.map((u) => u.email)
|
||||
.reverse()
|
||||
: users
|
||||
.slice(-3)
|
||||
.map((u) => u.email)
|
||||
.reverse() || [];
|
||||
return users.length > 4
|
||||
? condensed.concat(`+${users.length - 3} more`) // TODO: confirm limit
|
||||
: condensed;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue