fix
This commit is contained in:
parent
b93c051d5f
commit
ed00b742a1
|
|
@ -136,13 +136,19 @@ function DocumentList({
|
|||
});
|
||||
}, [documents]);
|
||||
|
||||
// Clean up blob URLs on unmount
|
||||
// Revoke superseded blob URLs as state changes, and on unmount.
|
||||
// Empty deps would capture the initial {} and never revoke anything.
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
Object.values(previews).forEach((url) => window.URL.revokeObjectURL(url));
|
||||
};
|
||||
}, [previews]);
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
Object.values(videoUrls).forEach((url) => window.URL.revokeObjectURL(url));
|
||||
};
|
||||
}, []);
|
||||
}, [videoUrls]);
|
||||
|
||||
const handleDownload = (doc: DocumentItem) => {
|
||||
const cached = previews[doc.id] || videoUrls[doc.id];
|
||||
|
|
|
|||
Loading…
Reference in New Issue