From a9b704382958ca2dc63bd41063162d3e3277be3f Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Fri, 18 Jul 2025 18:05:15 +0200 Subject: refactor: improve timeline elements, fix few bugs --- apps/web/src/stores/timeline-store.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apps/web/src/stores') 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) => void; startDrag: ( elementId: string, @@ -230,6 +231,8 @@ export const useTimelineStore = create((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((set, get) => { clickOffsetTime: 0, currentTime: 0, }, + justFinishedDragging: true, }); + + setTimeout(() => { + set({ justFinishedDragging: false }); + }, 50); }, // Persistence methods -- cgit v1.3.1