mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-13 22:01:06 +00:00
fix metadata change view bug (#6929)
This commit is contained in:
@@ -17,8 +17,10 @@ const DetailContainer = React.memo(({ repoID, path, dirent, currentRepoInfo, rep
|
|||||||
window.sfMetadataContext = context;
|
window.sfMetadataContext = context;
|
||||||
window.sfMetadataContext.init({ repoID, repoInfo: currentRepoInfo });
|
window.sfMetadataContext.init({ repoID, repoInfo: currentRepoInfo });
|
||||||
return () => {
|
return () => {
|
||||||
window.sfMetadataContext.destroy();
|
if (window.sfMetadataContext) {
|
||||||
delete window['sfMetadataContext'];
|
window.sfMetadataContext.destroy();
|
||||||
|
delete window['sfMetadataContext'];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}, [repoID, currentRepoInfo, path]);
|
}, [repoID, currentRepoInfo, path]);
|
||||||
|
|
||||||
|
@@ -27,8 +27,10 @@ const EmbeddedFileDetails = ({ repoID, repoInfo, dirent, path, onClose, width =
|
|||||||
});
|
});
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
window.sfMetadataContext.destroy();
|
if (window.sfMetadataContext) {
|
||||||
delete window['sfMetadataContext'];
|
window.sfMetadataContext.destroy();
|
||||||
|
delete window['sfMetadataContext'];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
@@ -100,7 +100,9 @@ export const MetadataViewProvider = ({
|
|||||||
const unsubscribeModifyColumnOrder = eventBus.subscribe(EVENT_BUS_TYPE.MODIFY_COLUMN_ORDER, modifyColumnOrder);
|
const unsubscribeModifyColumnOrder = eventBus.subscribe(EVENT_BUS_TYPE.MODIFY_COLUMN_ORDER, modifyColumnOrder);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
window.sfMetadataContext.destroy();
|
if (window.sfMetadataContext) {
|
||||||
|
window.sfMetadataContext.destroy();
|
||||||
|
}
|
||||||
window.sfMetadataStore.destroy();
|
window.sfMetadataStore.destroy();
|
||||||
unsubscribeServerTableChanged();
|
unsubscribeServerTableChanged();
|
||||||
unsubscribeTableChanged();
|
unsubscribeTableChanged();
|
||||||
|
Reference in New Issue
Block a user