From da56d8d4bb00d84d2a0e655d0be2f39b23addc20 Mon Sep 17 00:00:00 2001 From: Rizky Date: Mon, 22 Jan 2024 19:23:58 +0700 Subject: [PATCH] wip fix --- app/web/src/nova/ed/logic/ed-route.ts | 6 ++++++ app/web/src/nova/ed/logic/ed-sync.tsx | 2 -- app/web/src/nova/ed/panel/main/main.tsx | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/web/src/nova/ed/logic/ed-route.ts b/app/web/src/nova/ed/logic/ed-route.ts index 785b7ead..6c045bd0 100644 --- a/app/web/src/nova/ed/logic/ed-route.ts +++ b/app/web/src/nova/ed/logic/ed-route.ts @@ -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(); } }; diff --git a/app/web/src/nova/ed/logic/ed-sync.tsx b/app/web/src/nova/ed/logic/ed-sync.tsx index d0ddcb39..aad642a6 100644 --- a/app/web/src/nova/ed/logic/ed-sync.tsx +++ b/app/web/src/nova/ed/logic/ed-sync.tsx @@ -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(); diff --git a/app/web/src/nova/ed/panel/main/main.tsx b/app/web/src/nova/ed/panel/main/main.tsx index 43a0a3d2..5db06f92 100644 --- a/app/web/src/nova/ed/panel/main/main.tsx +++ b/app/web/src/nova/ed/panel/main/main.tsx @@ -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; `,