From 2257ca2e6f9f8834880ea9bab4355c168ee6c33b Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Thu, 5 Feb 2026 12:53:56 +0100 Subject: make storage versioning per-project + few other refactors --- apps/web/src/core/managers/project-manager.ts | 35 +++------------------------ 1 file changed, 3 insertions(+), 32 deletions(-) (limited to 'apps/web/src/core/managers') diff --git a/apps/web/src/core/managers/project-manager.ts b/apps/web/src/core/managers/project-manager.ts index fc0b2a36..94576879 100644 --- a/apps/web/src/core/managers/project-manager.ts +++ b/apps/web/src/core/managers/project-manager.ts @@ -21,7 +21,7 @@ import { buildDefaultScene, getProjectDurationFromScenes } from "@/lib/scenes"; import { buildScene } from "@/services/renderer/scene-builder"; import { CanvasRenderer } from "@/services/renderer/canvas-renderer"; import { - CURRENT_STORAGE_VERSION, + CURRENT_PROJECT_VERSION, migrations, runStorageMigrations, } from "@/services/storage/migrations"; @@ -58,31 +58,7 @@ export class ProjectManager { } this.storageMigrationPromise = (async () => { - let hasShownState = false; - - await runStorageMigrations({ - migrations, - callbacks: { - onMigrationStart: ({ fromVersion, toVersion }) => { - hasShownState = true; - this.setMigrationState({ - isMigrating: true, - fromVersion, - toVersion, - projectName: null, - }); - }, - }, - }); - - if (hasShownState) { - this.setMigrationState({ - isMigrating: false, - fromVersion: null, - toVersion: null, - projectName: null, - }); - } + await runStorageMigrations({ migrations }); })(); await this.storageMigrationPromise; @@ -109,7 +85,7 @@ export class ProjectManager { color: DEFAULT_COLOR, }, }, - version: CURRENT_STORAGE_VERSION, + version: CURRENT_PROJECT_VERSION, }; this.active = newProject; @@ -572,11 +548,6 @@ export class ProjectManager { return this.migrationState; } - private setMigrationState(state: Partial): void { - this.migrationState = { ...this.migrationState, ...state }; - this.notify(); - } - setActiveProject({ project }: { project: TProject }): void { this.active = project; this.notify(); -- cgit v1.3.1