Skip to content

Commit 2f53c14

Browse files
committed
Use normalizeProject when applying presets
1 parent 9f82360 commit 2f53c14

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

apps/desktop/src/routes/editor/PresetsDropdown.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DropdownMenu as KDropdownMenu } from "@kobalte/core/dropdown-menu";
22
import { cx } from "cva";
33
import { createSignal, For, Show, Suspense } from "solid-js";
44
import { reconcile } from "solid-js/store";
5-
import { useEditorContext } from "./context";
5+
import { normalizeProject, useEditorContext } from "./context";
66
import {
77
DropdownItem,
88
dropdownContainerClasses,
@@ -47,12 +47,11 @@ export function PresetsDropdown() {
4747

4848
function applyPreset() {
4949
setShowSettings(false);
50-
setProject(
51-
reconcile({
52-
...preset.config,
53-
timeline: project.timeline,
54-
}),
55-
);
50+
const normalizedConfig = normalizeProject({
51+
...preset.config,
52+
timeline: project.timeline,
53+
});
54+
setProject(reconcile(normalizedConfig));
5655
}
5756

5857
return (

apps/desktop/src/routes/editor/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function withCornerDefaults<
8686
};
8787
}
8888

89-
function normalizeProject(
89+
export function normalizeProject(
9090
config: ProjectConfiguration,
9191
): EditorProjectConfiguration {
9292
return {

0 commit comments

Comments
 (0)