summaryrefslogtreecommitdiff
path: root/apps/web/src/lib/commands/timeline/element/duplicate-elements.ts
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-04-18 16:01:35 +0200
committerMaze Winther <mazewinther@gmail.com>2026-04-18 16:01:35 +0200
commit8bdc894690752b1a9b29beb98d128eb0eec27d42 (patch)
tree8a7160ad15569ca7bc6e0c96867c7183cd3f0a46 /apps/web/src/lib/commands/timeline/element/duplicate-elements.ts
parent0387bd4c80f699cf0272fa0165d3c86dceaf39dc (diff)
downloadopencut-8bdc894690752b1a9b29beb98d128eb0eec27d42.tar.gz
fix: migrate commands to CommandResult selection contract
Diffstat (limited to 'apps/web/src/lib/commands/timeline/element/duplicate-elements.ts')
-rw-r--r--apps/web/src/lib/commands/timeline/element/duplicate-elements.ts15
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/web/src/lib/commands/timeline/element/duplicate-elements.ts b/apps/web/src/lib/commands/timeline/element/duplicate-elements.ts
index ab7a4a25..c044a4e3 100644
--- a/apps/web/src/lib/commands/timeline/element/duplicate-elements.ts
+++ b/apps/web/src/lib/commands/timeline/element/duplicate-elements.ts
@@ -1,8 +1,15 @@
-import { Command, type CommandResult } from "@/lib/commands/base-command";
+import {
+ Command,
+ createElementSelectionResult,
+ type CommandResult,
+} from "@/lib/commands/base-command";
import type { SceneTracks, TimelineElement } from "@/lib/timeline";
import { generateUUID } from "@/utils/id";
import { EditorCore } from "@/core";
-import { applyPlacement, resolveTrackPlacement } from "@/lib/timeline/placement";
+import {
+ applyPlacement,
+ resolveTrackPlacement,
+} from "@/lib/timeline/placement";
import { cloneAnimations } from "@/lib/animation";
interface DuplicateElementsParams {
@@ -91,9 +98,7 @@ export class DuplicateElementsCommand extends Command {
editor.timeline.updateTracks(updatedTracks);
if (this.duplicatedElements.length > 0) {
- return {
- select: this.duplicatedElements,
- };
+ return createElementSelectionResult(this.duplicatedElements);
}
return undefined;
}