This commit is contained in:
Rizky 2024-01-22 19:23:58 +07:00
parent 0bcbac81d4
commit da56d8d4bb
3 changed files with 7 additions and 2 deletions

View File

@ -98,6 +98,12 @@ export const reloadPage = async (p: PG, page_id: string, note: string) => {
);
p.ui.syncing = false;
p.page.entry = (doc as any)
.getMap("map")
.get("root")
?.get("childs")
?.map((e: any) => e.get("id")) as string[];
if (p.ui.should_render) p.render();
}
};

View File

@ -165,7 +165,6 @@ export const edInitSync = (p: PG) => {
decompress(data.sv_local)
);
const sv_remote = Y.encodeStateVector(doc);
const sv = Buffer.from(compress(sv_remote));
const diff = Buffer.from(compress(diff_remote));
const res = await p.sync.yjs.sv_remote(
@ -185,7 +184,6 @@ export const edInitSync = (p: PG) => {
p.comp.list[data.id].meta = updated.meta;
p.comp.list[data.id].tree = updated.tree;
}
await treeRebuild(p, { note: "sv_remote" });
}
p.render();

View File

@ -106,6 +106,7 @@ const mainStyle = (p: PG, meta?: IMeta) => {
: "inset-0",
css`
width: ${width};
height: ${`${(1 / scale) * 100}%`};
transform: scale(${scale});
transform-origin: 0% 0% 0px;
`,