Skip to content

Commit

Permalink
Don't show rules in details if group is readonly (#4407)
Browse files Browse the repository at this point in the history
  • Loading branch information
megrogan authored Sep 21, 2023
1 parent 0323c49 commit 2362adb
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,18 @@
export let chat: MultiUserChat;
export let memberCount: number;
$: currentChatRules = client.currentChatRules;
$: currentCommunityRules = client.currentCommunityRules;
$: combinedRulesText = client.combineRulesText($currentChatRules, $currentCommunityRules);
// capture a snapshot of the chat as it is right now
$: canEdit = client.canEditGroupDetails(chat.id);
$: canSend = client.canSendMessages(chat.id) || client.canReplyInThread(chat.id);
$: canInvite = client.canInviteUsers(chat.id) && (chat.kind === "group_chat" || chat.public);
$: avatarSrc = client.groupAvatarUrl(chat);
$: currentChatRules = client.currentChatRules;
$: currentCommunityRules = client.currentCommunityRules;
$: combinedRulesText = canSend
? client.combineRulesText($currentChatRules, $currentCommunityRules)
: "";
function editGroup() {
if (canEdit) {
dispatch("editGroup", { chat, rules: { ...$currentChatRules, newVersion: false } });
Expand Down

0 comments on commit 2362adb

Please sign in to comment.