diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-08-26 15:04:25 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-08-26 15:04:25 +0200 |
| commit | b459b46802a760a4a81ce91fdf24390e07375fb0 (patch) | |
| tree | e0070578d2b57acfba5f119cbf1abc6c9db5e741 /apps/web/src/stores/sounds-store.ts | |
| parent | 2f7cd11ca123884969f90a94e59593d355518839 (diff) | |
| download | opencut-b459b46802a760a4a81ce91fdf24390e07375fb0.tar.gz | |
refactor: type-safety & separate concerns
Diffstat (limited to 'apps/web/src/stores/sounds-store.ts')
| -rw-r--r-- | apps/web/src/stores/sounds-store.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/web/src/stores/sounds-store.ts b/apps/web/src/stores/sounds-store.ts index 215253fb..6dffa198 100644 --- a/apps/web/src/stores/sounds-store.ts +++ b/apps/web/src/stores/sounds-store.ts @@ -247,7 +247,7 @@ export const useSoundsStore = create<SoundsStore>((set, get) => ({ type: "audio/mpeg",
});
- await useMediaStore.getState().addMediaItem(activeProject.id, {
+ await useMediaStore.getState().addMediaFile(activeProject.id, {
name: sound.name,
type: "audio",
file,
@@ -257,12 +257,12 @@ export const useSoundsStore = create<SoundsStore>((set, get) => ({ const mediaItem = useMediaStore
.getState()
- .mediaItems.find((item) => item.file === file);
+ .mediaFiles.find((item) => item.file === file);
if (!mediaItem) throw new Error("Failed to create media item");
const success = useTimelineStore
.getState()
- .addMediaAtTime(mediaItem, usePlaybackStore.getState().currentTime);
+ .addElementAtTime(mediaItem, usePlaybackStore.getState().currentTime);
if (success) {
return true;
|
