fix: defer revoking group file download URL
This commit is contained in:
@@ -128,7 +128,8 @@ export function GroupFilesModal({ topicId, isAdmin, canUpload, onClose }: GroupF
|
|||||||
link.href = url;
|
link.href = url;
|
||||||
link.download = f.file_name;
|
link.download = f.file_name;
|
||||||
link.click();
|
link.click();
|
||||||
URL.revokeObjectURL(url);
|
// Keep the object URL alive long enough for the browser to start the download.
|
||||||
|
window.setTimeout(() => URL.revokeObjectURL(url), 1000);
|
||||||
})
|
})
|
||||||
.catch(() => setDownloadError('文件下载失败,可能已过期'));
|
.catch(() => setDownloadError('文件下载失败,可能已过期'));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user