File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,9 +23,7 @@ const ChannelHeader = () => {
2323 const isCollapsed = state === "collapsed"
2424 const { toggleStarChannel, isStarred } = useChannel ( channelID )
2525
26- const pinnedCount = channel ?. pinned_messages_string ?. split ( "\n" ) . length || 0
27- console . log ( channel ?. pinned_messages_string )
28- console . log ( pinnedCount )
26+ const pinnedCount = channel ?. pinned_messages_string ? channel . pinned_messages_string . split ( "\n" ) . length : 0
2927
3028 const [ drawerType , setDrawerType ] = useAtom ( channelDrawerAtom ( channelID ) )
3129
@@ -122,7 +120,7 @@ const ChannelHeader = () => {
122120 < Button variant = "ghost" size = "default" className = "h-7 gap-2 rounded-sm" onClick = { onOpenPins } >
123121 < Pin className = "h-2 w-2 text-foreground/80" />
124122 < span className = "sr-only" > { _ ( 'Pinned' ) } </ span >
125- < span className = "text-muted-foreground text-sm font-normal" > { pinnedCount } </ span >
123+ { pinnedCount > 0 && < span className = "text-muted-foreground text-sm font-normal" > { pinnedCount } </ span > }
126124 </ Button >
127125 </ TooltipTrigger >
128126 < TooltipContent >
You can’t perform that action at this time.
0 commit comments