Skip to content

Commit

Permalink
Add 'Reactions' to Quick Filtering (Message Type/Category)
Browse files Browse the repository at this point in the history
  • Loading branch information
prathercc committed Sep 14, 2024
1 parent 753f93a commit 50a7ec1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ const FilterComponent = ({
MessageType.CALL,
MessageCategory.PINNED,
MessageType.CHANNEL_PINNED_MESSAGE,
MessageCategory.REACTIONS,
]}
displayNameMap={{
[MessageType.CALL]: "Call",
[MessageType.CHANNEL_PINNED_MESSAGE]: "Pin Notification",
[MessageCategory.PINNED]: "Pinned",
[MessageCategory.REACTIONS]: "Reactions",
}}
/>

Expand Down
1 change: 1 addition & 0 deletions src/enum/message-category.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export enum MessageCategory {
PINNED = "pinned",
REACTIONS = "reactions",
}
3 changes: 2 additions & 1 deletion src/features/message/message-slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ const _filterMessageType = (
const messageHasType = _filterValue.some((fv) => {
return (
messageTypeEquals(message.type, fv as MessageType) ||
(fv === MessageCategory.PINNED && message.pinned)
(fv === MessageCategory.PINNED && message.pinned) ||
(fv === MessageCategory.REACTIONS && !!message.reactions?.length)
);
});
const criteriaMet =
Expand Down

0 comments on commit 50a7ec1

Please sign in to comment.