fix(core): error when delete tags (#13207)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Adjusted the placement of a conditional check to improve code organization. No changes to user-facing functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -109,11 +109,6 @@ export const TagDetail = ({ tagId }: { tagId?: string }) => {
|
|||||||
tagId,
|
tagId,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!currentTag || !tagId) {
|
|
||||||
return <PageNotFound />;
|
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
||||||
const handleDisplayPreferenceChange = useCallback(
|
const handleDisplayPreferenceChange = useCallback(
|
||||||
(displayPreference: ExplorerDisplayPreference) => {
|
(displayPreference: ExplorerDisplayPreference) => {
|
||||||
explorerContextValue.displayPreference$.next(displayPreference);
|
explorerContextValue.displayPreference$.next(displayPreference);
|
||||||
@@ -121,6 +116,10 @@ export const TagDetail = ({ tagId }: { tagId?: string }) => {
|
|||||||
[explorerContextValue]
|
[explorerContextValue]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!currentTag || !tagId) {
|
||||||
|
return <PageNotFound />;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DocExplorerContext.Provider value={explorerContextValue}>
|
<DocExplorerContext.Provider value={explorerContextValue}>
|
||||||
<ViewTitle title={tagName ?? 'Untitled'} />
|
<ViewTitle title={tagName ?? 'Untitled'} />
|
||||||
|
|||||||
Reference in New Issue
Block a user