wip fix
This commit is contained in:
parent
a296b35eff
commit
9bcb823201
|
|
@ -9,6 +9,16 @@ export default page({
|
|||
component: ({}) => {
|
||||
const p = useGlobal(EDGlobal, "EDITOR");
|
||||
|
||||
const w = window as any;
|
||||
if (!w.Y) {
|
||||
(async () => {
|
||||
(window as any).Y = await import("yjs");
|
||||
(window as any).syncronize = (await import("y-pojo")).syncronize;
|
||||
p.render();
|
||||
})();
|
||||
return <Loading note="init" />;
|
||||
}
|
||||
|
||||
if (!edInitSync(p)) {
|
||||
return <Loading note="connecting-ws" />;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,9 @@ import { Root } from "./base/root";
|
|||
import "./index.css";
|
||||
import { createAPI, createDB, reloadDBAPI } from "./utils/script/init-api";
|
||||
import { w } from "./utils/types/general";
|
||||
import * as Y from "yjs";
|
||||
import { registerMobile } from "./render/live/logic/mobile";
|
||||
import { isLocalhost } from "./utils/ui/is-localhost";
|
||||
|
||||
(window as any).Y = Y;
|
||||
|
||||
const start = async () => {
|
||||
const base = `${location.protocol}//${location.host}`;
|
||||
let react = {
|
||||
|
|
@ -142,7 +139,7 @@ const start = async () => {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
defineReact();
|
||||
await defineWindow(false);
|
||||
w.serverurl = base;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export const treeRebuild = async (p: PG, arg?: { note?: string }) => {
|
|||
p.page.entry.push(e.get("id"));
|
||||
}
|
||||
syncWalkMap(p, {
|
||||
isLayout: false,
|
||||
isLayout: true,
|
||||
mitem: e,
|
||||
parent_item: { id: root_id },
|
||||
tree_root_id: root_id,
|
||||
|
|
|
|||
|
|
@ -193,6 +193,7 @@ export const syncWalkMap = (
|
|||
parent_mcomp: { mitem: mitem as MItem, mcomp },
|
||||
portal: arg.portal,
|
||||
skip_add_tree: skip_tree_child,
|
||||
each: arg.each,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -211,6 +212,7 @@ export const syncWalkMap = (
|
|||
parent_mcomp: { mitem: mitem as MItem, mcomp },
|
||||
skip_add_tree: true,
|
||||
portal: arg.portal,
|
||||
each: arg.each,
|
||||
});
|
||||
}
|
||||
return;
|
||||
|
|
@ -258,6 +260,7 @@ export const syncWalkMap = (
|
|||
parent_mcomp: arg.parent_mcomp,
|
||||
portal: arg.portal,
|
||||
skip_add_tree: skip_tree_child,
|
||||
each: arg.each,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue