Skip to content

Commit a952877

Browse files
Apply suggestions from code review
Co-authored-by: Brian Smith <[email protected]>
1 parent 98b5cf9 commit a952877

4 files changed

Lines changed: 5 additions & 10 deletions

File tree

src/taxonomy/tag-list/UsageCountDisplay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { Row } from '@tanstack/react-table';
55
import type {
66
TreeRowData,
77
} from '@src/taxonomy/tree-table/types';
8-
import { TagListRowData } from './types';
8+
import type { TagListRowData } from './types';
99
import { getTagListRowData } from './utils';
1010

1111
const UsageCountDisplay = ({ row }: { row: Row<TreeRowData>; }) => {

src/taxonomy/tag-list/tagColumns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import type {
1616
TreeColumnDef,
1717
TreeRowData,
1818
} from '@src/taxonomy/tree-table/types';
19-
import { TagListRowData } from './types';
19+
import type { TagListRowData } from './types';
2020
import messages from './messages';
2121
import OptionalExpandLink from './OptionalExpandLink';
2222
import UsageCountDisplay from './UsageCountDisplay';

src/taxonomy/tag-list/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TreeRowData } from '@src/taxonomy/tree-table/types';
1+
import type { TreeRowData } from '@src/taxonomy/tree-table/types';
22

33
export interface TagListRowData extends TreeRowData {
44
depth: number;

src/taxonomy/tree-table/SaveErrorAlert.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,11 @@ interface SaveErrorAlertProps {
1515
}
1616
const SaveErrorAlert = ({ draftError, isError, isUpdateError }: SaveErrorAlertProps) => {
1717
const intl = useIntl();
18-
const hasError = (isError || isUpdateError) && !!draftError;
18+
const hasError: boolean = (isError || isUpdateError) && !!draftError;
1919
const [alertOpen, setAlertOpen] = React.useState(hasError);
2020

2121
useEffect(() => {
22-
if (hasError) {
23-
setAlertOpen(true);
24-
}
25-
if (!hasError) {
26-
setAlertOpen(false);
27-
}
22+
setAlertOpen(hasError);
2823
}, [hasError, isError, isUpdateError, draftError]);
2924

3025
if (!alertOpen) { return null; }

0 commit comments

Comments
 (0)