summaryrefslogtreecommitdiff
path: root/apps/web/src/lib/commands/media/add-media-asset.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/src/lib/commands/media/add-media-asset.ts')
-rw-r--r--apps/web/src/lib/commands/media/add-media-asset.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/web/src/lib/commands/media/add-media-asset.ts b/apps/web/src/lib/commands/media/add-media-asset.ts
index 8b3067a1..12e0906e 100644
--- a/apps/web/src/lib/commands/media/add-media-asset.ts
+++ b/apps/web/src/lib/commands/media/add-media-asset.ts
@@ -54,11 +54,15 @@ export class AddMediaAssetCommand extends Command {
assets: currentAssets.filter((asset) => asset.id !== this.assetId),
});
- const currentTracks = editor.timeline.getTracks();
+ const currentTracks = editor.scenes.getActiveScene().tracks;
const orphanedElements: Array<{ trackId: string; elementId: string }> =
[];
- for (const track of currentTracks) {
+ for (const track of [
+ ...currentTracks.overlay,
+ currentTracks.main,
+ ...currentTracks.audio,
+ ]) {
for (const element of track.elements) {
if (hasMediaId(element) && element.mediaId === this.assetId) {
orphanedElements.push({