wip fix
This commit is contained in:
parent
ce4b1a5f7a
commit
57b4bf9c24
|
|
@ -4,7 +4,6 @@ import { fetchViaProxy } from "../proxy";
|
|||
|
||||
export const loadApiProxyDef = async (_url: string, with_types: boolean) => {
|
||||
const url = trim(_url, "/");
|
||||
console.log(url, _url);
|
||||
const raw = await fetchViaProxy(urlPath(url, "/_prasi/_"));
|
||||
let ver = "";
|
||||
if (raw && (raw as any).prasi) {
|
||||
|
|
|
|||
|
|
@ -6,25 +6,27 @@ import { Loading } from "../../utils/ui/loading";
|
|||
import init from "wasm-gzip";
|
||||
|
||||
export default page({
|
||||
url: "/ed/:site_id/:page_id",
|
||||
component: ({}) => {
|
||||
const p = useGlobal(EDGlobal, "EDITOR");
|
||||
url: "/ed/:site_id/:page_id",
|
||||
component: ({}) => {
|
||||
const p = useGlobal(EDGlobal, "EDITOR");
|
||||
|
||||
const w = window as any;
|
||||
if (!w.Y) {
|
||||
(async () => {
|
||||
await init();
|
||||
(window as any).Y = await import("yjs");
|
||||
(window as any).syncronize = (await import("y-pojo")).syncronize;
|
||||
p.render();
|
||||
})();
|
||||
return <Loading note="init" />;
|
||||
}
|
||||
const w = window as any;
|
||||
if (!w.Y) {
|
||||
(async () => {
|
||||
await init();
|
||||
(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" />;
|
||||
}
|
||||
w.isEditor = true;
|
||||
|
||||
return <EdBase />;
|
||||
},
|
||||
if (!edInitSync(p)) {
|
||||
return <Loading note="connecting-ws" />;
|
||||
}
|
||||
|
||||
return <EdBase />;
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { ViRoot } from "./root";
|
|||
import { ErrorBox } from "./utils/error-box";
|
||||
import { render_stat } from "./render/render";
|
||||
|
||||
const w = window as any;
|
||||
export const Vi: FC<{
|
||||
meta: Record<string, IMeta>;
|
||||
mode: "mobile" | "desktop";
|
||||
|
|
@ -36,6 +37,10 @@ export const Vi: FC<{
|
|||
}) => {
|
||||
const vi = useGlobal(ViGlobal, "VI");
|
||||
vi.mode = mode;
|
||||
|
||||
w.isMobile = mode === "mobile";
|
||||
w.isDesktop = mode === "desktop";
|
||||
|
||||
vi.on_status_changes = on_status_changed;
|
||||
|
||||
if (rs === "disabled") {
|
||||
|
|
|
|||
Loading…
Reference in New Issue