diff --git a/frontend/app/src/components/home/AcceptRulesModal.svelte b/frontend/app/src/components/home/AcceptRulesModal.svelte index 49887065ff..a7b899f4b7 100644 --- a/frontend/app/src/components/home/AcceptRulesModal.svelte +++ b/frontend/app/src/components/home/AcceptRulesModal.svelte @@ -7,19 +7,11 @@ const dispatch = createEventDispatcher(); const client = getContext("client"); - // Deliberately not reactive statements so that the rules don't change while the user is reading them let currentChatRules = client.currentChatRules; let currentCommunityRules = client.currentCommunityRules; let chatRulesEnabled = $currentChatRules?.enabled ?? false; let communityRulesEnabled = $currentCommunityRules?.enabled ?? false; - function buildConfirmMessage(): string { - const chatRulesText = chatRulesEnabled ? $currentChatRules?.text : ""; - const comunityRulesText = communityRulesEnabled ? $currentCommunityRules?.text : ""; - let lineBreak = chatRulesEnabled && communityRulesEnabled ? "\n\n" : ""; - return comunityRulesText + lineBreak + chatRulesText; - } - function onAction(accepted: boolean): Promise { let chatRulesVersion = undefined; let communityRulesVersion = undefined; @@ -43,7 +35,7 @@ diff --git a/frontend/app/src/components/home/RightPanel.svelte b/frontend/app/src/components/home/RightPanel.svelte index 2019cb5de9..bbea7ddbcb 100644 --- a/frontend/app/src/components/home/RightPanel.svelte +++ b/frontend/app/src/components/home/RightPanel.svelte @@ -46,7 +46,6 @@ $: currentChatMembers = client.currentChatMembers; $: currentChatInvited = client.currentChatInvitedUsers; $: currentChatBlocked = client.currentChatBlockedUsers; - $: currentChatRules = client.currentChatRules; $: currentChatPinnedMessages = client.currentChatPinnedMessages; $: currentCommunityMembers = client.currentCommunityMembers; $: currentCommunityInvited = client.currentCommunityInvitedUsers; @@ -348,7 +347,6 @@ 0 && rules.text.length <= MAX_RULES_LENGTH); $: rulesDirty = rules.text !== originalRules.text || rules.enabled !== originalRules.enabled; + function buildRulesExplanation(level: Level): string | undefined { + switch (level) { + case "community": + return $_("rules.communityRulesExplanation"); + case "channel": + return $_("rules.channelRulesExplanation"); + case "group": + return undefined; + } + } + function toggleRules() { rules.enabled = !rules.enabled; } @@ -41,7 +52,9 @@ checked={rules.enabled} />
{interpolateLevel("rules.instructions", level, true)}
- +