Skip to content

Commit 83fdd06

Browse files
authored
Merge pull request #695 from GetStream/channel-type-permissions-update
channel-type-permissions-update
2 parents db63a8e + f912e08 commit 83fdd06

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/Message/hooks/usePinHandler.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ export const usePinHandler = (message, permissions, notifications) => {
1212
const { t } = useContext(TranslationContext);
1313

1414
const canPin = () => {
15-
if (!client || !channel?.state || !permissions) return false;
15+
if (
16+
!client ||
17+
!channel?.state ||
18+
!permissions ||
19+
!permissions[channel.type]
20+
) {
21+
return false;
22+
}
1623

1724
const currentChannelPermissions = permissions[channel.type];
1825
const currentChannelMember = channel.state.members[client.userID];

0 commit comments

Comments
 (0)