1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-26 07:22:34 +00:00

feat: optimize code

This commit is contained in:
杨国璇
2025-01-09 16:28:50 +08:00
parent e8f261e0a9
commit e63fd15785
17 changed files with 124 additions and 130 deletions

View File

@@ -38,6 +38,7 @@ const MapViewToolBar = ({
}, []);
useEffect(() => {
setShowGalleryToolbar(false);
const unsubscribeToggle = window.sfMetadataContext.eventBus.subscribe(EVENT_BUS_TYPE.TOGGLE_VIEW_TOOLBAR, onToggle);
const unsubscribeView = window.sfMetadataContext.eventBus.subscribe(EVENT_BUS_TYPE.RESET_VIEW, resetView);
return () => {
@@ -45,10 +46,6 @@ const MapViewToolBar = ({
unsubscribeView && unsubscribeView();
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
useEffect(() => {
setShowGalleryToolbar(false);
}, [viewID]);
if (showGalleryToolbar) {