From 7e4cd767622e3e1a09e76770ce800f4a541cf0e8 Mon Sep 17 00:00:00 2001 From: Zaka <149817565+ZakaHaceCosas@users.noreply.github.com> Date: Fri, 15 Aug 2025 23:01:18 +0200 Subject: feat: add an input so the user can go to a specific timestamp (#530) * feat: add an input so the user can go to a specific timestamp * fix: use TimeCode type for EditableTimecodeProps * cleanup --------- Co-authored-by: Maze Winther --- apps/web/src/stores/project-store.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'apps/web/src/stores/project-store.ts') diff --git a/apps/web/src/stores/project-store.ts b/apps/web/src/stores/project-store.ts index 259533bf..5ff88418 100644 --- a/apps/web/src/stores/project-store.ts +++ b/apps/web/src/stores/project-store.ts @@ -8,6 +8,7 @@ import { generateUUID } from "@/lib/utils"; import { CanvasSize, CanvasMode } from "@/types/editor"; export const DEFAULT_CANVAS_SIZE: CanvasSize = { width: 1920, height: 1080 }; +export const DEFAULT_FPS = 30; const DEFAULT_PROJECT: TProject = { id: generateUUID(), @@ -19,7 +20,7 @@ const DEFAULT_PROJECT: TProject = { backgroundType: "color", blurIntensity: 8, bookmarks: [], - fps: 30, + fps: DEFAULT_FPS, canvasSize: DEFAULT_CANVAS_SIZE, canvasMode: "preset", }; @@ -77,7 +78,7 @@ export const useProjectStore = create((set, get) => ({ if (!activeProject) return; // Round time to the nearest frame - const fps = activeProject.fps || 30; + const fps = activeProject.fps || DEFAULT_FPS; const frameTime = Math.round(time * fps) / fps; const bookmarks = activeProject.bookmarks || []; @@ -119,7 +120,7 @@ export const useProjectStore = create((set, get) => ({ if (!activeProject || !activeProject.bookmarks) return false; // Round time to the nearest frame - const fps = activeProject.fps || 30; + const fps = activeProject.fps || DEFAULT_FPS; const frameTime = Math.round(time * fps) / fps; return activeProject.bookmarks.some( @@ -132,7 +133,7 @@ export const useProjectStore = create((set, get) => ({ if (!activeProject || !activeProject.bookmarks) return; // Round time to the nearest frame - const fps = activeProject.fps || 30; + const fps = activeProject.fps || DEFAULT_FPS; const frameTime = Math.round(time * fps) / fps; const updatedBookmarks = activeProject.bookmarks.filter( -- cgit v1.3.1