mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-17 03:10:38 +09:00
fix: address greptile feedback
This commit is contained in:
parent
22b38b1956
commit
a0a28fce38
4 changed files with 37 additions and 3 deletions
|
|
@ -29,11 +29,14 @@ export function suggestedCommentAssigneeValue(
|
|||
issue: CommentAssigneeSuggestionInput,
|
||||
comments: CommentAssigneeSuggestionComment[] | null | undefined,
|
||||
currentUserId: string | null | undefined,
|
||||
currentAgentId?: string | null | undefined,
|
||||
): string {
|
||||
if (comments && comments.length > 0 && currentUserId) {
|
||||
if (comments && comments.length > 0 && (currentUserId || currentAgentId)) {
|
||||
for (let i = comments.length - 1; i >= 0; i--) {
|
||||
const comment = comments[i];
|
||||
if (comment.authorAgentId) return assigneeValueFromSelection({ assigneeAgentId: comment.authorAgentId });
|
||||
if (comment.authorAgentId && comment.authorAgentId !== currentAgentId) {
|
||||
return assigneeValueFromSelection({ assigneeAgentId: comment.authorAgentId });
|
||||
}
|
||||
if (comment.authorUserId && comment.authorUserId !== currentUserId) {
|
||||
return assigneeValueFromSelection({ assigneeUserId: comment.authorUserId });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue