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