fix
This commit is contained in:
parent
4c158cf1b3
commit
ec687fe052
|
|
@ -42,7 +42,7 @@ export const yjs_diff_local: SAction["yjs"]["diff_local"] = async function (
|
|||
ts: history[id],
|
||||
},
|
||||
});
|
||||
|
||||
setTimeout(async () => {
|
||||
const res = await _db.page_history.findMany({
|
||||
where: {
|
||||
id_page: id,
|
||||
|
|
@ -76,11 +76,12 @@ export const yjs_diff_local: SAction["yjs"]["diff_local"] = async function (
|
|||
}
|
||||
last_ts = ts;
|
||||
}
|
||||
await _db.page_history.deleteMany({
|
||||
_db.page_history.deleteMany({
|
||||
where: { id: { in: ids } },
|
||||
});
|
||||
});
|
||||
} else {
|
||||
await _db.page_history.updateMany({
|
||||
_db.page_history.updateMany({
|
||||
data: {
|
||||
content_tree: await gzipAsync(JSON.stringify(root.toJSON())),
|
||||
},
|
||||
|
|
@ -91,7 +92,7 @@ export const yjs_diff_local: SAction["yjs"]["diff_local"] = async function (
|
|||
});
|
||||
}
|
||||
|
||||
await _db.page.update({
|
||||
_db.page.update({
|
||||
where: { id },
|
||||
data: {
|
||||
content_tree: root.toJSON(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue