Skip to content

Commit

Permalink
fix: search metadata bug (#7288)
Browse files Browse the repository at this point in the history
Co-authored-by: 杨国璇 <[email protected]>
  • Loading branch information
YangGuoXuan-0503 and 杨国璇 authored Dec 31, 2024
1 parent e6008aa commit 01509b0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/dir-view-mode/dir-views/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const DirViews = ({ userPerm, repoID, currentPath, currentRepoInfo }) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [window.app.pageOptions.enableMetadataManagement, currentRepoInfo]);

const { navigation } = useMetadata();
const { isLoading, navigation } = useMetadata();
const { enableMetadata } = useMetadataStatus();

let [isSettingsDialogOpen, setSettingsDialogOpen] = useState(false);
Expand Down Expand Up @@ -58,7 +58,7 @@ const DirViews = ({ userPerm, repoID, currentPath, currentRepoInfo }) => {
>
{!enableMetadata ? (
<ExtensionPrompts onExtendedProperties={onExtendedProperties} />
) : Array.isArray(navigation) && navigation.length > 0 ? (
) : !isLoading && Array.isArray(navigation) && navigation.length > 0 ? (
<MetadataTreeView userPerm={userPerm} currentPath={currentPath} />
) : null}
</TreeSection>
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/dirent-detail/dirent-details/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class DirentDetails extends React.Component {
}

updateDetail = (repoID, dirent, direntPath) => {
if (!dirent) {
this.setState({ dirent: null, direntDetail: '' });
return;
}
const apiName = dirent.type === 'file' ? 'getFileInfo' : 'getDirInfo';
seafileAPI[apiName](repoID, direntPath).then(res => {
this.setState(({
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/metadata/hooks/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export const MetadataProvider = ({ repoID, currentPath, repoInfo, hideMetadataVi
}
hideMetadataView && hideMetadataView();
setEnableFaceRecognition(false);
setIdViewMap({});
setNavigation([]);
setIdViewMap({});
setLoading(false);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [repoID, enableMetadata]);
Expand Down Expand Up @@ -442,6 +442,7 @@ export const MetadataProvider = ({ repoID, currentPath, repoInfo, hideMetadataVi

return (
<MetadataContext.Provider value={{
isLoading,
enableFaceRecognition,
updateEnableFaceRecognition,
isBeingBuilt,
Expand Down

0 comments on commit 01509b0

Please sign in to comment.