interface: dedupe pendings in DM sidebar

Fixes urbit/landscape#1184
This commit is contained in:
Liam Fitzgerald 2021-09-23 12:09:05 +10:00
parent 57d0a7def4
commit 802a0f91c2

View File

@ -1,6 +1,7 @@
import React, { ReactElement, useCallback } from 'react';
import { Associations, Graph } from '@urbit/api';
import { patp, patp2dec } from 'urbit-ob';
import _ from 'lodash';
import { SidebarAssociationItem, SidebarDmItem } from './SidebarItem';
import useGraphState, { useInbox } from '~/logic/state/graph';
@ -86,7 +87,7 @@ function getItems(associations: Associations, workspace: Workspace, inbox: Graph
? []
: Array.from(pending).map(s => `~${s}`);
return [...filtered, ...direct, ...pend];
return [...filtered, ..._.union(direct, pend)];
}
export function SidebarList(props: {