wip fix
This commit is contained in:
parent
6ecaa36108
commit
0392922c68
|
|
@ -39,7 +39,7 @@ export const EdPageHistoryMain: FC<{}> = ({}) => {
|
||||||
if (e) {
|
if (e) {
|
||||||
const zip = new Uint8Array((e.content_tree as any).data);
|
const zip = new Uint8Array((e.content_tree as any).data);
|
||||||
const root = JSON.parse(decoder.decode(decompress(zip))) as IRoot;
|
const root = JSON.parse(decoder.decode(decompress(zip))) as IRoot;
|
||||||
local.root = root;
|
local.root = JSON.parse(JSON.stringify(root));
|
||||||
await initLoadComp(
|
await initLoadComp(
|
||||||
{
|
{
|
||||||
comps: p.comp.loaded,
|
comps: p.comp.loaded,
|
||||||
|
|
@ -99,11 +99,9 @@ export const EdPageHistoryMain: FC<{}> = ({}) => {
|
||||||
p.page.history.show = false;
|
p.page.history.show = false;
|
||||||
|
|
||||||
p.page.doc?.transact(() => {
|
p.page.doc?.transact(() => {
|
||||||
const root = p.page.doc?.getMap("map").get("root");
|
const map = new Y.Map();
|
||||||
|
syncronize(map, local.root);
|
||||||
if (root) {
|
p.page.doc?.getMap("map").set("root", map as any);
|
||||||
syncronize(root as any, local.root);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await treeRebuild(p);
|
await treeRebuild(p);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ export const EdPageHistoryList = () => {
|
||||||
const local = useLocal(
|
const local = useLocal(
|
||||||
{ loading: true, list: [] as Awaited<ReturnType<typeof queryList>> },
|
{ loading: true, list: [] as Awaited<ReturnType<typeof queryList>> },
|
||||||
async () => {
|
async () => {
|
||||||
console.log("query list");
|
|
||||||
local.list = await queryList(p.page.cur.id);
|
local.list = await queryList(p.page.cur.id);
|
||||||
local.loading = false;
|
local.loading = false;
|
||||||
local.render();
|
local.render();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue