Fix editor regressions and add Blender scene and animated material import

This commit is contained in:
emil28092005
2026-09-12 00:53:20 +03:00
parent 1a0bf725fa
commit 6f497d1977
34 changed files with 1241 additions and 213 deletions
+4 -4
View File
@@ -7,10 +7,10 @@ function db(): Promise<IDBDatabase> {
req.onerror = () => reject(req.error);
});
}
export async function loadDraft() {
export async function loadDraft(key = "active") {
const d = await db();
return new Promise<Project | null>((resolve, reject) => {
const r = d.transaction("projects").objectStore("projects").get("active");
const r = d.transaction("projects").objectStore("projects").get(key);
r.onsuccess = () => {
d.close();
if (r.result) {
@@ -25,11 +25,11 @@ export async function loadDraft() {
r.onerror = () => reject(r.error);
});
}
export async function saveDraft(p: Project) {
export async function saveDraft(p: Project, key = "active") {
const d = await db();
return new Promise<void>((resolve, reject) => {
const tx = d.transaction("projects", "readwrite");
tx.objectStore("projects").put(p, "active");
tx.objectStore("projects").put(p, key);
tx.oncomplete = () => {
d.close();
resolve();