summaryrefslogtreecommitdiff
path: root/apps/web/src/stores/timeline-store.ts
diff options
context:
space:
mode:
authorKha Nguyen <hi@khanguyen.com>2025-07-24 16:50:14 -0500
committerKha Nguyen <hi@khanguyen.com>2025-07-24 16:50:14 -0500
commit262a7d53d63cc9997f730c7f64b7f8ec29723926 (patch)
tree894d6e3986b3ca339dc3ff7ec62fb31b3690be82 /apps/web/src/stores/timeline-store.ts
parent5a7745f806edf4a386b8cfd079861f96c3b92baf (diff)
parent5931ddb77aac23ffe1b82d9d7c03afde3e671109 (diff)
downloadopencut-262a7d53d63cc9997f730c7f64b7f8ec29723926.tar.gz
Merge branch 'main' into fix/improve-shortcuts
Diffstat (limited to 'apps/web/src/stores/timeline-store.ts')
-rw-r--r--apps/web/src/stores/timeline-store.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/web/src/stores/timeline-store.ts b/apps/web/src/stores/timeline-store.ts
index 8a4abc6a..820025cc 100644
--- a/apps/web/src/stores/timeline-store.ts
+++ b/apps/web/src/stores/timeline-store.ts
@@ -295,9 +295,8 @@ export const useTimelineStore = create<TimelineStore>((set, get) => {
{ trackId, elementId },
],
};
- } else {
- return { selectedElements: [{ trackId, elementId }] };
}
+ return { selectedElements: [{ trackId, elementId }] };
});
},
@@ -680,7 +679,8 @@ export const useTimelineStore = create<TimelineStore>((set, get) => {
(element) => element.id !== elementId
),
};
- } else if (track.id === toTrackId) {
+ }
+ 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
- let mediaData: any = {
+ const mediaData: any = {
name: newFile.name,
type: fileType,
file: newFile,
@@ -1204,7 +1204,8 @@ export const useTimelineStore = create<TimelineStore>((set, get) => {
);
const { thumbnailUrl } = await generateVideoThumbnail(mediaItem.file);
return thumbnailUrl;
- } else if (mediaItem.type === "image" && mediaItem.url) {
+ }
+ if (mediaItem.type === "image" && mediaItem.url) {
return mediaItem.url;
}