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:
EYHN
2025-07-15 14:50:54 +08:00
committed by GitHub
parent 95a97b793c
commit 316c671c92

View File

@@ -109,11 +109,6 @@ export const TagDetail = ({ tagId }: { tagId?: string }) => {
tagId,
]);
if (!currentTag || !tagId) {
return <PageNotFound />;
}
// eslint-disable-next-line react-hooks/rules-of-hooks
const handleDisplayPreferenceChange = useCallback(
(displayPreference: ExplorerDisplayPreference) => {
explorerContextValue.displayPreference$.next(displayPreference);
@@ -121,6 +116,10 @@ export const TagDetail = ({ tagId }: { tagId?: string }) => {
[explorerContextValue]
);
if (!currentTag || !tagId) {
return <PageNotFound />;
}
return (
<DocExplorerContext.Provider value={explorerContextValue}>
<ViewTitle title={tagName ?? 'Untitled'} />