File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -456,20 +456,21 @@ const AssignUnassignEventView = ({ event }: { event: AssignEvent | UnassignEvent
456456 const { actor } = event ;
457457 const assignees = ( event as AssignEvent ) . assignees || [ ] ;
458458 const unassignees = ( event as UnassignEvent ) . unassignees || [ ] ;
459- const joinedAssignees = joinWithAnd ( assignees . map ( a => < AuthorLink key = { `${ a . id } a` } for = { a } /> ) ) ;
460- const joinedUnassignees = joinWithAnd ( unassignees . map ( a => < AuthorLink key = { `${ a . id } u` } for = { a } /> ) ) ;
461-
459+
462460 // Check if actor is assigning/unassigning themselves
463461 const isSelfAssign = assignees . length === 1 && assignees [ 0 ] . login === actor . login ;
464462 const isSelfUnassign = unassignees . length === 1 && unassignees [ 0 ] . login === actor . login ;
465463
466464 let message : JSX . Element ;
467465 if ( assignees . length > 0 && unassignees . length > 0 ) {
468- message = < > assigned { joinedAssignees } and unassigned { joinedUnassignees } </ > ;
466+ // Handle mixed case with potential self-assignment
467+ const assignMessage = isSelfAssign ? < > assigned themselves</ > : < > assigned { joinWithAnd ( assignees . map ( a => < AuthorLink key = { `${ a . id } a` } for = { a } /> ) ) } </ > ;
468+ const unassignMessage = isSelfUnassign ? < > removed their assignment</ > : < > unassigned { joinWithAnd ( unassignees . map ( a => < AuthorLink key = { `${ a . id } u` } for = { a } /> ) ) } </ > ;
469+ message = < > { assignMessage } and { unassignMessage } </ > ;
469470 } else if ( assignees . length > 0 ) {
470- message = isSelfAssign ? < > assigned themselves</ > : < > assigned { joinedAssignees } </ > ;
471+ message = isSelfAssign ? < > assigned themselves</ > : < > assigned { joinWithAnd ( assignees . map ( a => < AuthorLink key = { ` ${ a . id } a` } for = { a } /> ) ) } </ > ;
471472 } else {
472- message = isSelfUnassign ? < > removed their assignment</ > : < > unassigned { joinedUnassignees } </ > ;
473+ message = isSelfUnassign ? < > removed their assignment</ > : < > unassigned { joinWithAnd ( unassignees . map ( a => < AuthorLink key = { ` ${ a . id } u` } for = { a } /> ) ) } </ > ;
473474 }
474475
475476 return (
You can’t perform that action at this time.
0 commit comments