This commit is contained in:
Rizky 2024-02-12 17:56:04 +07:00
parent 6ecaa36108
commit 0392922c68
2 changed files with 4 additions and 7 deletions

View File

@ -39,7 +39,7 @@ export const EdPageHistoryMain: FC<{}> = ({}) => {
if (e) {
const zip = new Uint8Array((e.content_tree as any).data);
const root = JSON.parse(decoder.decode(decompress(zip))) as IRoot;
local.root = root;
local.root = JSON.parse(JSON.stringify(root));
await initLoadComp(
{
comps: p.comp.loaded,
@ -99,11 +99,9 @@ export const EdPageHistoryMain: FC<{}> = ({}) => {
p.page.history.show = false;
p.page.doc?.transact(() => {
const root = p.page.doc?.getMap("map").get("root");
if (root) {
syncronize(root as any, local.root);
}
const map = new Y.Map();
syncronize(map, local.root);
p.page.doc?.getMap("map").set("root", map as any);
});
await treeRebuild(p);

View File

@ -7,7 +7,6 @@ export const EdPageHistoryList = () => {
const local = useLocal(
{ loading: true, list: [] as Awaited<ReturnType<typeof queryList>> },
async () => {
console.log("query list");
local.list = await queryList(p.page.cur.id);
local.loading = false;
local.render();