{#if editing} { if (!$profile?.jwt || newComment.length <= 0) return try { await getClient().editComment({ auth: $profile.jwt, comment_id: node.comment_view.comment.id, content: newComment, }) node.comment_view.comment.content = newComment editing = false toast({ content: 'Successfully edited comment. You may need to refresh to see changes.', type: 'success', }) } catch (err) { toast({ // @ts-ignore i hate this content: err, type: 'error', }) } }} > Edit comment {/if}
  • {#if op} OP {/if} {#if !open}
    {node.comment_view.counts.score}
    {/if} • {Math.floor( (node.comment_view.counts.upvotes / (node.comment_view.counts.upvotes + node.comment_view.counts.downvotes)) * 100 ) || 0}%
    {#if node.comment_view.comment.updated} {/if} {#if node.comment_view.comment.deleted || node.comment_view.comment.removed} {/if} {#if node.comment_view.saved} {/if} {#if open} {:else} {#if node.children.length > 0} +{node.children.length} {/if} {/if}
    {#if actions}
    (editing = true)} />
    {/if}
    {#if replying}

    Reply

    { node.children.push({ children: [], comment_view: e.detail.comment_view, depth: node.depth + 1, }) replying = false }} />
    {/if}