diff options
| author | Kha Nguyen <hi@khanguyen.com> | 2025-07-24 17:04:27 -0500 |
|---|---|---|
| committer | Kha Nguyen <hi@khanguyen.com> | 2025-07-24 17:04:27 -0500 |
| commit | 8e737d87e0accbf1d433f4c8b1e8e0f125849799 (patch) | |
| tree | 386560ac1449991da1ab6d43637e82046a725e71 /apps/web/src/stores/timeline-store.ts | |
| parent | 1ccacf6bb5db579cf6f343d9de57bce92d296f5f (diff) | |
| download | opencut-8e737d87e0accbf1d433f4c8b1e8e0f125849799.tar.gz | |
Revert "merge main"
This reverts commit 1ccacf6bb5db579cf6f343d9de57bce92d296f5f.
Diffstat (limited to 'apps/web/src/stores/timeline-store.ts')
| -rw-r--r-- | apps/web/src/stores/timeline-store.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/web/src/stores/timeline-store.ts b/apps/web/src/stores/timeline-store.ts index 820025cc..8a4abc6a 100644 --- a/apps/web/src/stores/timeline-store.ts +++ b/apps/web/src/stores/timeline-store.ts @@ -295,8 +295,9 @@ export const useTimelineStore = create<TimelineStore>((set, get) => { { trackId, elementId }, ], }; + } else { + return { selectedElements: [{ trackId, elementId }] }; } - return { selectedElements: [{ trackId, elementId }] }; }); }, @@ -679,8 +680,7 @@ export const useTimelineStore = create<TimelineStore>((set, get) => { (element) => element.id !== elementId ), }; - } - if (track.id === toTrackId) { + } else if (track.id === toTrackId) { return { ...track, elements: [...track.elements, elementToMove], @@ -1091,7 +1091,7 @@ export const useTimelineStore = create<TimelineStore>((set, get) => { if (!fileType) return false; // Process the new media file - const mediaData: any = { + let mediaData: any = { name: newFile.name, type: fileType, file: newFile, @@ -1204,8 +1204,7 @@ export const useTimelineStore = create<TimelineStore>((set, get) => { ); const { thumbnailUrl } = await generateVideoThumbnail(mediaItem.file); return thumbnailUrl; - } - if (mediaItem.type === "image" && mediaItem.url) { + } else if (mediaItem.type === "image" && mediaItem.url) { return mediaItem.url; } |
