Fixes issue where logs modal had wrong indicator icon

Fixes issue where status wasn't updating between list and detail correctly
This commit is contained in:
wess committed 2024-02-27 14:32:16 -05:00
1 parent b4f69e7c63
commit cd7a9136e9
2 files changed
+10 -9

No files matched your search

@@ -20,9 +20,7 @@
let enabled: boolean;
onMount(async () => {
enabled ??= $webhook.enabled;
console.log('webhook', $webhook.$id);
enabled = $webhook.enabled;
});
let showFailed = false;
@@ -71,13 +69,16 @@
<li>Created: {toLocaleDateTime($webhook.$createdAt)}</li>
<li>Last updated: {toLocaleDateTime($webhook.$updatedAt)}</li>
</ul>
<MessageStatusPill {enabled} />
<MessageStatusPill enabled={$webhook.enabled} />
</div>
</svelte:fragment>
<svelte:fragment slot="actions">
<div class="u-flex u-gap-16">
<Button on:click={() => (showFailed = true)} secondary>View logs</Button>
{#if $webhook.logs.length > 0}
<Button on:click={() => (showFailed = true)} secondary>View logs</Button>
{/if}
<Button on:click={setEnabled} disabled={enabled === $webhook.enabled} submit
>Update</Button>
</div>
@@ -14,16 +14,16 @@
const webhookPath = webhook
? `${base}/console/project-${projectId}/settings/webhooks/` + (webhook['$id'] ?? '')
: '';
$: style = `color: ${webhook.enabled ? 'hsl(var(--color-success-100))' : 'hsl(var(--color-danger-100))'}`;
$: iconClass = webhook.enabled ? 'icon-check-circle' : 'icon-exclamation-circle';
</script>
<Modal title="Webhook error" headerDivider={false} bind:show size="big">
<div class="box u-flex-vertical u-gap-24">
<div class="u-inline-flex u-cross-center u-gap-8">
<p class="u-stretch">
<span
class="icon-exclamation-circle u-font-size-20"
aria-hidden="true"
style="color:hsl(var(--color-danger-100));" />
<span class={`${iconClass} u-font-size-20`} aria-hidden="true" {style} />
<span>Webhook {webhook.enabled ? 'enabled' : 'disabled'}</span>
</p>