Skip to content

Commit

Permalink
Merge pull request #2369 from daostack/bugfix/CW-2345-space-item-in-i…
Browse files Browse the repository at this point in the history
…nbox

Space (project) card appearing in the Inbox #2345
  • Loading branch information
andreymikhadyuk authored Nov 30, 2023
2 parents 1fc6932 + e4f200b commit 2ba2be0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/shared/hooks/useCases/useInboxItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useIsMounted } from "@/shared/hooks";
import { FeedLayoutItemWithFollowData } from "@/shared/interfaces";
import {
ChatChannel,
CommonFeedType,
FeedItemFollow,
FeedItemFollowWithMetadata,
} from "@/shared/models";
Expand Down Expand Up @@ -189,13 +190,16 @@ export const useInboxItems = (
return;
}

const filteredData = data.filter(({ item }) =>
[CommonFeedType.Discussion, CommonFeedType.Proposal].includes(item.type),
);
const finalData =
feedItemIdsForNotListening && feedItemIdsForNotListening.length > 0
? data.filter(
? filteredData.filter(
(item) =>
!feedItemIdsForNotListening.includes(item.item.feedItemId),
)
: data;
: filteredData;
setNewItemsBatches((currentItems) => [...currentItems, finalData]);
};

Expand Down

0 comments on commit 2ba2be0

Please sign in to comment.