summaryrefslogtreecommitdiff
path: root/apps/web/src/core/managers
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-02-05 12:53:56 +0100
committerMaze Winther <mazewinther@gmail.com>2026-02-05 12:53:56 +0100
commit2257ca2e6f9f8834880ea9bab4355c168ee6c33b (patch)
treef2ead774beda94d95fb771bc3eb16972fb08468a /apps/web/src/core/managers
parent490fc170c0705703728a889cbc35a04ca41ae7eb (diff)
downloadopencut-2257ca2e6f9f8834880ea9bab4355c168ee6c33b.tar.gz
make storage versioning per-project + few other refactors
Diffstat (limited to 'apps/web/src/core/managers')
-rw-r--r--apps/web/src/core/managers/project-manager.ts35
1 files changed, 3 insertions, 32 deletions
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<MigrationState>): void {
- this.migrationState = { ...this.migrationState, ...state };
- this.notify();
- }
-
setActiveProject({ project }: { project: TProject }): void {
this.active = project;
this.notify();