From 599c4db17547cc01b51ff08558ee5351fdea5130 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Tue, 5 Jan 2021 12:30:36 -0600 Subject: [PATCH] interface: place priority in understanding state of channel in graphKeys --- .../src/views/landscape/components/Sidebar/Apps.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/interface/src/views/landscape/components/Sidebar/Apps.tsx b/pkg/interface/src/views/landscape/components/Sidebar/Apps.tsx index c359d09aba..eacecdd3c5 100644 --- a/pkg/interface/src/views/landscape/components/Sidebar/Apps.tsx +++ b/pkg/interface/src/views/landscape/components/Sidebar/Apps.tsx @@ -46,16 +46,17 @@ export function useGraphModule( ): SidebarAppConfig { const getStatus = useCallback( (s: string) => { - const unreads = graphUnreads?.[s]?.['/']?.unreads; - if(typeof unreads === 'number' ? unreads > 0 : unreads?.size ?? 0 > 0) { - return 'unread'; - } const [, , host, name] = s.split("/"); const graphKey = `${host.slice(1)}/${name}`; - if (!graphKeys.has(graphKey)) { return "unsubscribed"; } + + const unreads = graphUnreads?.[s]?.['/']?.unreads; + if (typeof unreads === 'number' ? unreads > 0 : unreads?.size ?? 0 > 0) { + return 'unread'; + } + return undefined; }, [graphs, graphKeys, graphUnreads]