1
0
mirror of https://github.com/spacebarchat/client.git synced 2024-11-22 10:22:30 +01:00

prevent trying to render channels when missing view permission

This commit is contained in:
Puyodead1 2023-12-18 12:05:36 -05:00
parent 9a9819cc51
commit 85ab5387c6
No known key found for this signature in database
GPG Key ID: BA5F91AAEF68E5CE

View File

@ -114,6 +114,22 @@ function Chat() {
); );
} }
if (!activeChannel.hasPermission("VIEW_CHANNEL")) {
return (
<WrapperTwo>
<span
style={{
color: "var(--text-secondary)",
fontSize: "1.5rem",
margin: "auto",
}}
>
You do not have permission to view this channel
</span>
</WrapperTwo>
);
}
return ( return (
<WrapperTwo> <WrapperTwo>
<ChatHeader channel={activeChannel} /> <ChatHeader channel={activeChannel} />