summaryrefslogtreecommitdiff
path: root/apps/web/src/services
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/src/services')
-rw-r--r--apps/web/src/services/storage/migrations/v0-to-v1.ts6
-rw-r--r--apps/web/src/services/storage/migrations/v1-to-v2.ts4
-rw-r--r--apps/web/src/services/storage/migrations/v2-to-v3.ts7
3 files changed, 16 insertions, 1 deletions
diff --git a/apps/web/src/services/storage/migrations/v0-to-v1.ts b/apps/web/src/services/storage/migrations/v0-to-v1.ts
index 7ec388f1..4997f3fa 100644
--- a/apps/web/src/services/storage/migrations/v0-to-v1.ts
+++ b/apps/web/src/services/storage/migrations/v0-to-v1.ts
@@ -1,3 +1,9 @@
+/*
+ * Ensures every project has at least one scene
+ * Adds a default "Main scene" if none exist
+ * Sets currentSceneId to the new scene's id
+ */
+
import { IndexedDBAdapter } from "@/services/storage/indexeddb-adapter";
import type { SerializedScene } from "@/services/storage/types";
import { buildDefaultScene } from "@/lib/scenes";
diff --git a/apps/web/src/services/storage/migrations/v1-to-v2.ts b/apps/web/src/services/storage/migrations/v1-to-v2.ts
index 05d302ea..b108f507 100644
--- a/apps/web/src/services/storage/migrations/v1-to-v2.ts
+++ b/apps/web/src/services/storage/migrations/v1-to-v2.ts
@@ -1,3 +1,7 @@
+/*
+ * Adds default values for new project properties introduced in v2
+ */
+
import {
DEFAULT_BLUR_INTENSITY,
DEFAULT_CANVAS_SIZE,
diff --git a/apps/web/src/services/storage/migrations/v2-to-v3.ts b/apps/web/src/services/storage/migrations/v2-to-v3.ts
index eb6db26d..7869812c 100644
--- a/apps/web/src/services/storage/migrations/v2-to-v3.ts
+++ b/apps/web/src/services/storage/migrations/v2-to-v3.ts
@@ -1,3 +1,6 @@
+/*
+ * Adds a "duration" field to each project's metadata,
+ */
import { getProjectDurationFromScenes } from "@/lib/scenes";
import { IndexedDBAdapter } from "@/services/storage/indexeddb-adapter";
import type { TScene } from "@/types/timeline";
@@ -84,7 +87,9 @@ function isV3Project({ project }: { project: ProjectRecord }): boolean {
return true;
}
- return isRecord(project.metadata) && typeof project.metadata.duration === "number";
+ return (
+ isRecord(project.metadata) && typeof project.metadata.duration === "number"
+ );
}
function isRecord(value: unknown): value is ProjectRecord {