From b097c06656fe3dcab50ed6886e9963620449e065 Mon Sep 17 00:00:00 2001 From: Darshan Date: Mon, 16 Dec 2024 12:01:22 +0530 Subject: [PATCH 1/2] fix: simplify draft checks. --- .../message-[message]/emailMessage.svelte | 18 +++++++----------- .../message-[message]/updateTargets.svelte | 12 +++++++----- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/routes/(console)/project-[project]/messaging/message-[message]/emailMessage.svelte b/src/routes/(console)/project-[project]/messaging/message-[message]/emailMessage.svelte index 6fcaad6d47..36c479683b 100644 --- a/src/routes/(console)/project-[project]/messaging/message-[message]/emailMessage.svelte +++ b/src/routes/(console)/project-[project]/messaging/message-[message]/emailMessage.svelte @@ -60,25 +60,21 @@ subject === message.data.subject && content === message.data.content && html === ((message.data['html'] ?? false) as boolean); + + $: isDraft = message.status === 'draft';
- +
Message
- - + + Enable the HTML mode if your message contains HTML tags. diff --git a/src/routes/(console)/project-[project]/messaging/message-[message]/updateTargets.svelte b/src/routes/(console)/project-[project]/messaging/message-[message]/updateTargets.svelte index 8c112fba95..c05bdce614 100644 --- a/src/routes/(console)/project-[project]/messaging/message-[message]/updateTargets.svelte +++ b/src/routes/(console)/project-[project]/messaging/message-[message]/updateTargets.svelte @@ -93,11 +93,13 @@ } } + $: isDraft = message.status === 'draft'; + $: disabled = symmetricDifference(targetIds, Object.keys(selectedTargetsById)).length === 0; - + Targets {@const sum = targetIds.length} @@ -106,7 +108,7 @@
Target
- {#if message.status == 'draft'} + {#if isDraft} + . +

+ + + {/if} +
+