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],
|
ts: history[id],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
setTimeout(async () => {
|
||||||
const res = await _db.page_history.findMany({
|
const res = await _db.page_history.findMany({
|
||||||
where: {
|
where: {
|
||||||
id_page: id,
|
id_page: id,
|
||||||
|
|
@ -76,11 +76,12 @@ export const yjs_diff_local: SAction["yjs"]["diff_local"] = async function (
|
||||||
}
|
}
|
||||||
last_ts = ts;
|
last_ts = ts;
|
||||||
}
|
}
|
||||||
await _db.page_history.deleteMany({
|
_db.page_history.deleteMany({
|
||||||
where: { id: { in: ids } },
|
where: { id: { in: ids } },
|
||||||
});
|
});
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
await _db.page_history.updateMany({
|
_db.page_history.updateMany({
|
||||||
data: {
|
data: {
|
||||||
content_tree: await gzipAsync(JSON.stringify(root.toJSON())),
|
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 },
|
where: { id },
|
||||||
data: {
|
data: {
|
||||||
content_tree: root.toJSON(),
|
content_tree: root.toJSON(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue