diff --git a/src/components/Comment.svelte b/src/components/Comment.svelte index 56f2a9f..f803d75 100644 --- a/src/components/Comment.svelte +++ b/src/components/Comment.svelte @@ -29,7 +29,6 @@ caption?: string; timestamp: number; lastEdit?: Edit; - disallowEmptyBody?: boolean; editComment?: (body: string, embeds: Embed[]) => Promise; reactOnComment?: (authors: Author[], reaction: string) => Promise; } @@ -46,7 +45,6 @@ caption = "commented", timestamp, lastEdit, - disallowEmptyBody = false, editComment, reactOnComment, }: Props = $props(); @@ -180,7 +178,6 @@ {body} {rid} {embeds} - {disallowEmptyBody} borderVariant="ghost" submitInProgress={state === "submit"} submitCaption="Save" diff --git a/src/components/CommentToggleInput.svelte b/src/components/CommentToggleInput.svelte index b32b217..abfc1cc 100644 --- a/src/components/CommentToggleInput.svelte +++ b/src/components/CommentToggleInput.svelte @@ -11,7 +11,6 @@ submit: (comment: string, embeds: Embed[]) => Promise; onclose?: () => void; onexpand?: () => void; - disallowEmptyBody?: boolean; } /* eslint-disable prefer-const */ @@ -22,7 +21,6 @@ submit, onclose, onexpand, - disallowEmptyBody = false, }: Props = $props(); /* eslint-enable prefer-const */ @@ -43,7 +41,6 @@ {#if state !== "collapsed"} ; submitInProgress?: boolean; disableSubmit?: boolean; - disallowEmptyBody?: boolean; isValid?: () => boolean; preview?: boolean; stylePadding?: string; @@ -54,7 +53,6 @@ embeds = new Map(), submitInProgress = false, disableSubmit = false, - disallowEmptyBody = false, isValid = () => true, stylePadding, borderVariant = "float", @@ -238,7 +236,11 @@
{#if preview}
- + {#if body.trim().length === 0} + Nothing to preview. + {:else} + + {/if}
{:else}