Simplify reactOnComment action

This commit is contained in:
Thomas Scholtes
2025-07-16 12:58:03 +02:00
committed by Rūdolfs Ošiņš
parent fdabbac599
commit a33799d62a
5 changed files with 6 additions and 16 deletions
+1 -3
View File
@@ -17,7 +17,6 @@
embeds: Embed[],
) => Promise<void>;
reactOnComment?: (
publicKey: string,
commentId: string,
authors: Author[],
reaction: string,
@@ -436,8 +435,7 @@
inline
rid={codeComments.rid}
{thread}
reactOnComment={codeComments.reactOnComment &&
partial(codeComments.reactOnComment, codeComments.config.publicKey)}
reactOnComment={codeComments.reactOnComment}
createReply={(codeComments.canReply ?? true)
? async (body, embeds) => {
await codeComments.createComment(body, embeds, thread.root.id);
+1 -2
View File
@@ -31,7 +31,6 @@
embeds: Embed[],
) => Promise<void>;
reactOnComment: (
publicKey: string,
commentId: string,
authors: Author[],
reaction: string,
@@ -149,7 +148,7 @@
)}
{editComment}
createReply={createComment}
reactOnComment={partial(reactOnComment, config.publicKey)} />
{reactOnComment} />
<div class="connector"></div>
{/each}
+1 -2
View File
@@ -221,7 +221,6 @@
}
async function reactOnComment(
publicKey: string,
commentId: string,
authors: Author[],
reaction: string,
@@ -239,7 +238,7 @@
reaction,
review: review.id,
active: !authors.find(
({ did }) => publicKeyFromDid(did) === publicKey,
({ did }) => publicKeyFromDid(did) === config.publicKey,
),
},
opts: { announce: $nodeRunning && $announce },
+1 -2
View File
@@ -129,7 +129,6 @@
}
async function reactOnComment(
publicKey: string,
commentId: string,
authors: Author[],
reaction: string,
@@ -144,7 +143,7 @@
reaction,
revision: revision.id,
active: !authors.find(
({ did }) => publicKeyFromDid(did) === publicKey,
({ did }) => publicKeyFromDid(did) === config.publicKey,
),
},
opts: { announce: $nodeRunning && $announce },
+2 -7
View File
@@ -230,7 +230,6 @@
}
async function reactOnComment(
publicKey: string,
commentId: string,
authors: Author[],
reaction: string,
@@ -244,7 +243,7 @@
id: commentId,
reaction,
active: !authors.find(
({ did }) => publicKeyFromDid(did) === publicKey,
({ did }) => publicKeyFromDid(did) === config.publicKey,
),
},
opts: { announce: $nodeRunning && $announce },
@@ -456,11 +455,7 @@
repo.delegates.map(delegate => delegate.did),
issue.body.author.did,
) && partial(editComment, issue.body.id)}
reactOnComment={partial(
reactOnComment,
config.publicKey,
issue.body.id,
)}>
reactOnComment={partial(reactOnComment, issue.body.id)}>
</CommentComponent>
</div>