@@ -112,23 +112,12 @@ class Dashboard extends React.Component<Props, State> {
112112 } = this . props ;
113113 const { activeChannelObject } = this . state ;
114114
115- let searchFilter = { } ;
116- if ( activeChannel ) {
117- searchFilter . everythingFeed = false ;
118- searchFilter . communityId = null ;
119- searchFilter . creatorId = null ;
120- searchFilter . channelId = activeChannel ;
121- } else if ( activeCommunity ) {
122- searchFilter . everythingFeed = false ;
123- searchFilter . channelId = null ;
124- searchFilter . creatorId = null ;
125- searchFilter . communityId = activeCommunity ;
126- } else {
127- searchFilter . channelId = null ;
128- searchFilter . communityId = null ;
129- searchFilter . creatorId = null ;
130- searchFilter . everythingFeed = false ;
131- }
115+ const searchFilter = {
116+ everythingFeed : false ,
117+ creatorId : null ,
118+ channelId : activeChannel || null ,
119+ communityId : activeChannel ? null : activeCommunity || null
120+ } ;
132121 const { title, description } = generateMetaInfo ( ) ;
133122
134123 if ( user ) {
@@ -145,9 +134,9 @@ class Dashboard extends React.Component<Props, State> {
145134
146135 // at this point we have succesfully validated a user, and the user has both a username and joined communities - we can show their thread feed!
147136 const communities = user . communityConnection . edges . map ( c => c && c . node ) ;
148- const activeCommunityObject = communities . filter (
137+ const activeCommunityObject = communities . find (
149138 c => c && c . id === activeCommunity
150- ) [ 0 ] ;
139+ ) ;
151140
152141 return (
153142 < DashboardWrapper data-cy = "inbox-view" id = "main" >
0 commit comments