diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js --- a/lib/shared/thread-utils.js +++ b/lib/shared/thread-utils.js @@ -1412,6 +1412,13 @@ const messageCreatorUserInfo = useSelector( state => state.userStore.userInfos[messageInfo.creator.id], ); + const hasCreateSidebarsPermission = useThreadHasPermission( + threadInfo, + threadPermissions.CREATE_SIDEBARS, + ); + if (!hasCreateSidebarsPermission) { + return false; + } if ( !messageInfo.id || @@ -1422,16 +1429,10 @@ } const messageCreatorRelationship = messageCreatorUserInfo?.relationshipStatus; - const creatorRelationshipHasBlock = - messageCreatorRelationship && - relationshipBlockedInEitherDirection(messageCreatorRelationship); - - const hasCreateSidebarsPermission = threadHasPermission( - threadInfo, - threadPermissions.CREATE_SIDEBARS, + return ( + !messageCreatorRelationship || + !relationshipBlockedInEitherDirection(messageCreatorRelationship) ); - - return hasCreateSidebarsPermission && !creatorRelationshipHasBlock; } function useSidebarExistsOrCanBeCreated(