mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-24 22:30:35 +08:00
Simplify reactOnComment action
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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}
|
||||
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user