refactor: reduce code duplication
This commit is contained in:
parent
350b55081c
commit
dd02e31380
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue