Skip to content

Commit 4da42e7

Browse files
committed
added check for create new golden record button
1 parent 02090bf commit 4da42e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

JeMPI_Apps/JeMPI_UI/src/components/reviewLink/ReviewLink.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ const ReviewLink = () => {
7575
} = useLinkReview(payload, refineSearchQuery, candidateThreshold)
7676
const { linkRecords, createNewGoldenRecord } = useRelink()
7777

78+
const shouldDisableCreateGoldenRecordButton = (): boolean =>
79+
!(goldenRecord && goldenRecord?.linkRecords.length > 1);
80+
7881
const mutateNotification = useMutation({
7982
mutationFn: (request: NotificationRequest) =>
8083
apiClient.updateNotification(request),
@@ -320,6 +323,7 @@ const ReviewLink = () => {
320323
<Button
321324
variant="outlined"
322325
onClick={() => setIsNewGoldenRecordDialogOpen(true)}
326+
disabled={shouldDisableCreateGoldenRecordButton()}
323327
>
324328
Create new golden record
325329
</Button>

0 commit comments

Comments
 (0)