wip fix
This commit is contained in:
parent
d997fbbaaa
commit
5d946f53a1
|
|
@ -106,7 +106,7 @@ export const page_load: SAction["page"]["load"] = async function (
|
|||
url: page.url,
|
||||
name: page.name,
|
||||
snapshot: await gzipAsync(bin),
|
||||
comps: await prepareComponentForPage(id, this, false),
|
||||
comps: (await prepareComponentForPage(id, this, false)) || {},
|
||||
};
|
||||
}
|
||||
} else if (snap && !ydoc) {
|
||||
|
|
@ -140,7 +140,7 @@ export const page_load: SAction["page"]["load"] = async function (
|
|||
url: snap.url,
|
||||
name: snap.name,
|
||||
snapshot: await gzipAsync(snap.bin),
|
||||
comps,
|
||||
comps: comps || {},
|
||||
};
|
||||
} else if (snap && ydoc) {
|
||||
user.active.add({
|
||||
|
|
@ -156,7 +156,7 @@ export const page_load: SAction["page"]["load"] = async function (
|
|||
url: snap.url,
|
||||
name: snap.name,
|
||||
snapshot: await gzipAsync(snap.bin),
|
||||
comps: await prepareComponentForPage(id, this, true),
|
||||
comps: (await prepareComponentForPage(id, this, true)) || {},
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,12 +16,16 @@ export const prepareComponentForPage = async (
|
|||
const _doc = doc ? doc : docs.page[page_id].doc;
|
||||
const root = _doc.getMap("map").get("root")?.toJSON() as IRoot;
|
||||
|
||||
if (root) {
|
||||
const result = {} as Record<string, EComp>;
|
||||
|
||||
if (reload_components) {
|
||||
root.component_ids = await loadCompForPage(root, sync);
|
||||
if (doc) {
|
||||
_doc.getMap("map").get("root")?.set("component_ids", root.component_ids);
|
||||
_doc
|
||||
.getMap("map")
|
||||
.get("root")
|
||||
?.set("component_ids", root.component_ids);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -38,4 +42,5 @@ export const prepareComponentForPage = async (
|
|||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue