diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-07-18 18:05:15 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-07-18 18:05:15 +0200 |
| commit | a9b704382958ca2dc63bd41063162d3e3277be3f (patch) | |
| tree | f88cfdcdcf41f6d0d12d54b5024c742f36e4b053 /apps/web/src/stores | |
| parent | 6ce8434615427a99f460bc3cdd0f7cea5ba118ef (diff) | |
| download | opencut-a9b704382958ca2dc63bd41063162d3e3277be3f.tar.gz | |
refactor: improve timeline elements, fix few bugs
Diffstat (limited to 'apps/web/src/stores')
| -rw-r--r-- | apps/web/src/stores/timeline-store.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/web/src/stores/timeline-store.ts b/apps/web/src/stores/timeline-store.ts index 9a2c7361..c85f5bd2 100644 --- a/apps/web/src/stores/timeline-store.ts +++ b/apps/web/src/stores/timeline-store.ts @@ -74,6 +74,7 @@ interface TimelineStore { clickOffsetTime: number; currentTime: number; }; + justFinishedDragging: boolean; setDragState: (dragState: Partial<TimelineStore["dragState"]>) => void; startDrag: ( elementId: string, @@ -230,6 +231,8 @@ export const useTimelineStore = create<TimelineStore>((set, get) => { // Snapping settings defaults snappingEnabled: true, + justFinishedDragging: false, + getSortedTracks: () => { const { _tracks } = get(); const tracksWithMain = ensureMainTrack(_tracks); @@ -938,7 +941,12 @@ export const useTimelineStore = create<TimelineStore>((set, get) => { clickOffsetTime: 0, currentTime: 0, }, + justFinishedDragging: true, }); + + setTimeout(() => { + set({ justFinishedDragging: false }); + }, 50); }, // Persistence methods |
