Skip to content

Commit

Permalink
fix null reference error (#301)
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinav Kumar <[email protected]>
  • Loading branch information
abhinavkrin authored Nov 11, 2023
1 parent 7511bb8 commit 0111e28
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/react/src/components/Message/MessageHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ const MessageHeaderTimestapCss = css`
color: #9ea2a8;
`;

const authenticatedUserId = useUserStore(state => state.userId);

const MessageHeader = ({ message }) => {
const { styleOverrides, classNames } = useComponentOverrides('MessageHeader');
const roles = useUserStore((state) => state.roles);
const authenticatedUserId = useUserStore((state) => state.userId);

const userActions = () => {
switch (message.t) {
Expand Down Expand Up @@ -128,13 +127,14 @@ const MessageHeader = ({ message }) => {
size="1em"
/>
)}
{message.starred && message.starred.find((u) => u._id === authenticatedUserId) && (
<Icon
style={{ marginInlineEnd: '0.4rem', opacity: 0.5 }}
name="star"
size="1em"
/>
)}
{message.starred &&
message.starred.find((u) => u._id === authenticatedUserId) && (
<Icon
style={{ marginInlineEnd: '0.4rem', opacity: 0.5 }}
name="star"
size="1em"
/>
)}
</Box>
);
}
Expand Down

0 comments on commit 0111e28

Please sign in to comment.