wip disable save
This commit is contained in:
parent
23de9e35d2
commit
8579cdcc6e
|
|
@ -31,13 +31,13 @@ export const diffLocal = (ws: any, msg: any) => {
|
||||||
if (msg.id) {
|
if (msg.id) {
|
||||||
const page = eg.edit.page[msg.id].doc.getMap("map").toJSON();
|
const page = eg.edit.page[msg.id].doc.getMap("map").toJSON();
|
||||||
try {
|
try {
|
||||||
await db.page.update({
|
// await db.page.update({
|
||||||
where: { id: page.id },
|
// where: { id: page.id },
|
||||||
data: {
|
// data: {
|
||||||
content_tree: page.content_tree,
|
// content_tree: page.content_tree,
|
||||||
updated_at: new Date(),
|
// updated_at: new Date(),
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
resolve();
|
resolve();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
@ -50,17 +50,17 @@ export const diffLocal = (ws: any, msg: any) => {
|
||||||
}, 1500);
|
}, 1500);
|
||||||
} else if (msg.mode === "comp") {
|
} else if (msg.mode === "comp") {
|
||||||
eg.edit.comp[msg.id].saveTimeout = setTimeout(async () => {
|
eg.edit.comp[msg.id].saveTimeout = setTimeout(async () => {
|
||||||
const comp = eg.edit.comp[msg.id].doc.getMap("map").toJSON();
|
// const comp = eg.edit.comp[msg.id].doc.getMap("map").toJSON();
|
||||||
await db.component.update({
|
// await db.component.update({
|
||||||
where: {
|
// where: {
|
||||||
id: msg.id,
|
// id: msg.id,
|
||||||
},
|
// },
|
||||||
data: {
|
// data: {
|
||||||
name: comp.name,
|
// name: comp.name,
|
||||||
content_tree: comp.content_tree,
|
// content_tree: comp.content_tree,
|
||||||
updated_at: new Date(),
|
// updated_at: new Date(),
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
}, 1500);
|
}, 1500);
|
||||||
} else if (msg.mode === "site") {
|
} else if (msg.mode === "site") {
|
||||||
clearTimeout(eg.edit.site[msg.id].saveTimeout);
|
clearTimeout(eg.edit.site[msg.id].saveTimeout);
|
||||||
|
|
|
||||||
|
|
@ -23,19 +23,19 @@ export const yjs_diff_local: SAction["yjs"]["diff_local"] = async function (
|
||||||
const root = doc.getMap("map").get("root") as any;
|
const root = doc.getMap("map").get("root") as any;
|
||||||
if (root) {
|
if (root) {
|
||||||
if (mode === "page") {
|
if (mode === "page") {
|
||||||
await db.page.update({
|
// await db.page.update({
|
||||||
where: { id },
|
// where: { id },
|
||||||
data: {
|
// data: {
|
||||||
content_tree: root.toJSON(),
|
// content_tree: root.toJSON(),
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
} else if (mode === "comp") {
|
} else if (mode === "comp") {
|
||||||
await db.component.update({
|
// await db.component.update({
|
||||||
where: { id },
|
// where: { id },
|
||||||
data: {
|
// data: {
|
||||||
content_tree: root.toJSON(),
|
// content_tree: root.toJSON(),
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue