1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-12 13:24:52 +00:00

fix: face recognition toolbar (#6927)

Co-authored-by: 杨国璇 <ygx@Hello-word.local>
This commit is contained in:
杨国璇
2024-10-21 15:37:50 +08:00
committed by GitHub
parent 4ce79038b9
commit a5953c51d6
3 changed files with 8 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import { Utils } from '../../utils/utils';
import toaster from '../../components/toast';
import { gettext } from '../../utils/constants';
import { PRIVATE_FILE_TYPE } from '../../constants';
import { FACE_RECOGNITION_VIEW_ID } from '../constants';
// This hook provides content related to seahub interaction, such as whether to enable extended attributes, views data, etc.
const MetadataContext = React.createContext(null);
@@ -82,8 +83,8 @@ export const MetadataProvider = ({ repoID, hideMetadataView, selectMetadataView,
viewsMap.current[view._id] = view;
});
}
viewsMap.current['_face_recognition'] = {
_id: '_face_recognition',
viewsMap.current[FACE_RECOGNITION_VIEW_ID] = {
_id: FACE_RECOGNITION_VIEW_ID,
name: gettext('Photos - classfied by people'),
type: PRIVATE_FILE_TYPE.FACE_RECOGNITION,
};
@@ -119,7 +120,7 @@ export const MetadataProvider = ({ repoID, hideMetadataView, selectMetadataView,
setStaticView([]);
return;
}
setStaticView([{ _id: '_face_recognition', type: 'view' }]);
setStaticView([{ _id: FACE_RECOGNITION_VIEW_ID, type: 'view' }]);
}, [enableFaceRecognition]);
const selectView = useCallback((view, isSelected) => {