1
0
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:
Michael An
2024-10-21 17:38:17 +08:00
committed by GitHub
parent 708a046d45
commit b69c350917
3 changed files with 11 additions and 5 deletions

View File

@@ -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]);

View File

@@ -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
}, []);