fix
This commit is contained in:
parent
b9f9877daa
commit
f0748f4954
|
|
@ -14,6 +14,7 @@ const start = async () => {
|
|||
let react = {
|
||||
root: null as null | ReactRoot,
|
||||
};
|
||||
(window as any).mobile = registerMobile();
|
||||
|
||||
if (
|
||||
!["localhost", "127.0.0.1", "trycloudflare.com", "ngrok"].find((e) =>
|
||||
|
|
|
|||
|
|
@ -32,9 +32,10 @@ export const initLive = async (p: PG, domain_or_siteid: string) => {
|
|||
if (p.status === "init") {
|
||||
p.status = "loading";
|
||||
|
||||
w.mobile = registerMobile();
|
||||
w.mobile.bind(p);
|
||||
w.mobile.send({ type: "ready" });
|
||||
if (w.mobile) {
|
||||
w.mobile.bind(p);
|
||||
w.mobile.send({ type: "ready" });
|
||||
}
|
||||
|
||||
w.isEditor = false;
|
||||
w.isLayout = true;
|
||||
|
|
|
|||
|
|
@ -2,12 +2,18 @@ import { FC, useState } from "react";
|
|||
import { createRoot } from "react-dom/client";
|
||||
import { GlobalContext, defineReact, defineWindow } from "web-utils";
|
||||
import { siteLoader } from "./site-loader";
|
||||
import { registerMobile } from "../live/logic/mobile";
|
||||
|
||||
const w = window as unknown as {
|
||||
prasiContext: any;
|
||||
rootRender: any;
|
||||
mobile: any;
|
||||
};
|
||||
|
||||
if (!w.mobile) {
|
||||
w.mobile = registerMobile();
|
||||
}
|
||||
|
||||
w.prasiContext = {
|
||||
global: {},
|
||||
render() {},
|
||||
|
|
|
|||
Loading…
Reference in New Issue