mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-07-21 09:02:57 +02:00
Dedupe contacts/sidebar by key not name
This commit is contained in:
@@ -140,11 +140,12 @@ export function Sidebar({
|
||||
[lastMessageTimes]
|
||||
);
|
||||
|
||||
// Deduplicate channels by name, keeping the first (lowest index)
|
||||
// Deduplicate channels by key only.
|
||||
// Channel names are not unique; distinct keys must remain visible.
|
||||
const uniqueChannels = useMemo(
|
||||
() =>
|
||||
channels.reduce<Channel[]>((acc, channel) => {
|
||||
if (!acc.some((c) => c.name === channel.name)) {
|
||||
if (!acc.some((c) => c.key === channel.key)) {
|
||||
acc.push(channel);
|
||||
}
|
||||
return acc;
|
||||
|
||||
Reference in New Issue
Block a user