Skip to content

Commit e7228cb

Browse files
committed
fix: lint
1 parent 530876a commit e7228cb

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/taxonomy/tag-list/DeleteModal.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ const DeleteModal = ({
2525
}: DeleteModalProps) => {
2626
const intl = useIntl();
2727

28-
if (!row) {
29-
return null;
30-
}
31-
3228
const handleConfirm = (row: Row<TreeRowData>) => {
3329
handleDeleteRow(row);
3430
setIsOpen(false);
@@ -40,8 +36,12 @@ const DeleteModal = ({
4036
setRow(null);
4137
};
4238

43-
const rowData = getTagListRowData(row);
44-
const count = useMemo(() => getTagWithDescendantsCount(rowData), [rowData]);
39+
const rowData = row ? getTagListRowData(row) : null;
40+
const count = useMemo(() => (rowData ? getTagWithDescendantsCount(rowData) : 0), [rowData]);
41+
42+
if (!row) {
43+
return null;
44+
}
4545

4646
const hasSubtags = count > 1;
4747
const typeToDeleteText = hasSubtags

0 commit comments

Comments
 (0)