mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 16:10:26 +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.init({ repoID, repoInfo: currentRepoInfo });
|
||||
return () => {
|
||||
window.sfMetadataContext.destroy();
|
||||
delete window['sfMetadataContext'];
|
||||
if (window.sfMetadataContext) {
|
||||
window.sfMetadataContext.destroy();
|
||||
delete window['sfMetadataContext'];
|
||||
}
|
||||
};
|
||||
}, [repoID, currentRepoInfo, path]);
|
||||
|
||||
|
@@ -27,8 +27,10 @@ const EmbeddedFileDetails = ({ repoID, repoInfo, dirent, path, onClose, width =
|
||||
});
|
||||
|
||||
return () => {
|
||||
window.sfMetadataContext.destroy();
|
||||
delete window['sfMetadataContext'];
|
||||
if (window.sfMetadataContext) {
|
||||
window.sfMetadataContext.destroy();
|
||||
delete window['sfMetadataContext'];
|
||||
}
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
Reference in New Issue
Block a user