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