Skip to content

🎥 Make videos programmatically with React

Update download-and-map-assets-to-file.ts

Jonny Burger164408727d3e
diff --git a/packages/renderer/src/assets/download-and-map-assets-to-file.ts b/packages/renderer/src/assets/download-and-map-assets-to-file.ts
index 2ae264b157..0fe4f77354 100644
--- a/packages/renderer/src/assets/download-and-map-assets-to-file.ts
+++ b/packages/renderer/src/assets/download-and-map-assets-to-file.ts
@@ -57,6 +57,11 @@ const notifyAssetIsDownloaded = (src: string, to: string) => {
[to: string]: boolean;
}
)[to] = false;
+
+ if (!hasBeenDownloadedMap[src]) {
+ hasBeenDownloadedMap[src] = {};
+ }
+
(
hasBeenDownloadedMap[src] as {
[to: string]: boolean;
@@ -113,7 +118,7 @@ const downloadAsset = async (
to: string,
onDownload: RenderMediaOnDownload
) => {
- if (hasBeenDownloadedMap[src]) {
+ if (hasBeenDownloadedMap[src]?.[to]) {
return;
}