Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ export const SubmissionHistoryModal: FC<SubmissionHistoryModalProps> = (props: S
[props.submissions],
)

const aiReviewersCount = useMemo(() => (props.aiReviewers?.length ?? 0) + 1, [props.aiReviewers])
const aiReviewers = useMemo(() => props.aiReviewers ?? [], [props.aiReviewers])
const aiReviewersCount = useMemo(() => (aiReviewers.length ?? 0) + 1, [aiReviewers])

const [toggledRows, setToggledRows] = useState(new Set<string>())

Expand Down Expand Up @@ -279,7 +280,7 @@ export const SubmissionHistoryModal: FC<SubmissionHistoryModalProps> = (props: S
<td className={styles.aiReviewersTableRow} colSpan={4}>
<div className={styles.aiReviewersTable}>
<AiReviewsTable
reviewers={props.aiReviewers!}
reviewers={aiReviewers}
submission={submission}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,13 +802,18 @@ export const TableSubmissionScreening: FC<Props> = (props: Props) => {
[historySourceSubmissions, primarySubmissionInfos],
)

const { historyByMember }: SubmissionHistoryPartition = submissionHistory
const { historyByMember, latestSubmissionIds }: SubmissionHistoryPartition = submissionHistory

const shouldShowHistoryActions = useMemo(
() => hasIsLatestFlag(primarySubmissionInfos),
[primarySubmissionInfos],
)

const filteredScreenings = useMemo(() => (
props.screenings
.filter(screening => latestSubmissionIds.has(screening.submissionId))
), [props.screenings, latestSubmissionIds])

const hasAnyScreeningAssignment = useMemo(
() => props.screenings.some(screening => Boolean(screening.myReviewResourceId)),
[props.screenings],
Expand Down Expand Up @@ -1172,7 +1177,7 @@ export const TableSubmissionScreening: FC<Props> = (props: Props) => {
) : (
<Table
columns={columns}
data={props.screenings}
data={filteredScreenings}
disableSorting
onToggleSort={_.noop}
removeDefaultSort
Expand Down
Loading