refactor: reduce code duplication

This commit is contained in:
Maze Winther 2025-09-01 16:19:14 +02:00
parent 350b55081c
commit dd02e31380
2 changed files with 3 additions and 8 deletions

View File

@ -13,6 +13,7 @@ import {
DialogTitle,
} from "@/components/ui/dialog";
import { Progress } from "@/components/ui/progress";
import { createMainScene } from "@/stores/project-store";
interface MigrationProgress {
current: number;
@ -87,13 +88,7 @@ export function ScenesMigrator({ children }: { children: React.ReactNode }) {
const migrateLegacyProject = async (project: TProject) => {
try {
const mainScene: Scene = {
id: generateUUID(),
name: "Main Scene",
isMain: true,
createdAt: new Date(),
updatedAt: new Date(),
};
const mainScene = createMainScene();
const migratedProject: TProject = {
...project,

View File

@ -11,7 +11,7 @@ import { CanvasSize, CanvasMode } from "@/types/editor";
export const DEFAULT_CANVAS_SIZE: CanvasSize = { width: 1920, height: 1080 };
export const DEFAULT_FPS = 30;
function createMainScene(): Scene {
export function createMainScene(): Scene {
return {
id: generateUUID(),
name: "Main Scene",