Merge pull request #14 from archem-team/bug/channel-permission

Message box Permission
pull/1073/head
teamabron 2025-01-16 18:32:35 +03:30 committed by GitHub
commit cb5aeb4144
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 21 additions and 19 deletions

View File

@ -257,25 +257,27 @@ export default observer(({ channel }: Props) => {
</Base> </Base>
); );
} }
console.log(channel) console.log(channel) //|| channel.channel_type != "DirectMessage"
if (!channel.havePermission("SendMessage") && channel.recipient?.relationship == "Blocked" || channel.recipient?.relationship == "BlockedOther"){ if (channel.channel_type != "SavedMessages")
return ( if (!channel.havePermission("SendMessage") && channel.channel_type == "TextChannel" || channel.recipient?.relationship == "Blocked" || channel.recipient?.relationship == "BlockedOther"){
<Base>
<Blocked> return (
<Action> <Base>
<PermissionTooltip <Blocked>
permission="SendMessages" <Action>
placement="top"> <PermissionTooltip
<ShieldX size={22} /> permission="SendMessages"
</PermissionTooltip> placement="top">
</Action> <ShieldX size={22} />
<div className="text"> </PermissionTooltip>
<Text id="app.main.channel.misc.no_sending" /> </Action>
</div> <div className="text">
</Blocked> <Text id="app.main.channel.misc.no_sending" />
</Base> </div>
); </Blocked>
} </Base>
);
}
// Push message content to draft. // Push message content to draft.
const setMessage = useCallback( const setMessage = useCallback(
(content?: string) => { (content?: string) => {