diff options
| author | Zaka <149817565+ZakaHaceCosas@users.noreply.github.com> | 2025-08-15 23:01:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-15 23:01:18 +0200 |
| commit | 7e4cd767622e3e1a09e76770ce800f4a541cf0e8 (patch) | |
| tree | a7cc92bc6d1fe1686da096cb67e308cedc731f5a /apps/web/src/stores/project-store.ts | |
| parent | 033a9aa1bcc06ee82d611ac2c7deb5575c2fa803 (diff) | |
| download | opencut-7e4cd767622e3e1a09e76770ce800f4a541cf0e8.tar.gz | |
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 <mazewinther@gmail.com>
Diffstat (limited to 'apps/web/src/stores/project-store.ts')
| -rw-r--r-- | apps/web/src/stores/project-store.ts | 9 |
1 files changed, 5 insertions, 4 deletions
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<ProjectStore>((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<ProjectStore>((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<ProjectStore>((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( |
