diff --git a/app/srv/ws/sync/actions/code_edit.ts b/app/srv/ws/sync/actions/code_edit.ts index 010646a6..151d2959 100644 --- a/app/srv/ws/sync/actions/code_edit.ts +++ b/app/srv/ws/sync/actions/code_edit.ts @@ -83,14 +83,14 @@ export const code_edit: SAction["code"]["edit"] = async function ( } }); - if (save_to === "comp") { + if (save_to === "comp" && comp_id) { await db.component.update({ where: { id: comp_id }, data: { content_tree: root.toJSON(), }, }); - } else { + } else if (page_id) { await db.page.update({ where: { id: page_id }, data: { @@ -120,14 +120,14 @@ export const code_edit: SAction["code"]["edit"] = async function ( mprop.set("valueBuilt", res.code.substring(6)); }); - if (save_to === "comp") { + if (save_to === "comp" && comp_id) { await db.component.update({ where: { id: comp_id }, data: { content_tree: root.toJSON(), }, }); - } else { + } else if (page_id) { await db.page.update({ where: { id: page_id }, data: { diff --git a/app/srv/ws/sync/editor/load-component.ts b/app/srv/ws/sync/editor/load-component.ts index 1e53377d..bf7a554c 100644 --- a/app/srv/ws/sync/editor/load-component.ts +++ b/app/srv/ws/sync/editor/load-component.ts @@ -56,9 +56,6 @@ export const loadComponent = async (comp_id: string, sync?: SyncConnection) => { const comp = await db.component.findFirst({ where: { id: comp_id } }); if (comp) { const item = comp.content_tree as IItem; - if (item.name === "card") { - console.log(item); - } if (item && item.component?.id !== comp.id) { item.component = { id: comp.id, props: {} }; }