From b9f9877daa432b5bd557a4bfdbe74dbdb9789e8d Mon Sep 17 00:00:00 2001 From: Rizky Date: Thu, 9 Nov 2023 04:53:48 +0700 Subject: [PATCH] fix --- app/web/src/index.tsx | 1 - app/web/src/render/live/logic/init.tsx | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/web/src/index.tsx b/app/web/src/index.tsx index b269cb87..98100853 100644 --- a/app/web/src/index.tsx +++ b/app/web/src/index.tsx @@ -14,7 +14,6 @@ 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) => diff --git a/app/web/src/render/live/logic/init.tsx b/app/web/src/render/live/logic/init.tsx index ea1e3d4f..a33a8f93 100644 --- a/app/web/src/render/live/logic/init.tsx +++ b/app/web/src/render/live/logic/init.tsx @@ -32,10 +32,9 @@ export const initLive = async (p: PG, domain_or_siteid: string) => { if (p.status === "init") { p.status = "loading"; - if (w.mobile && w.mobile.bind && w.mobile.send) { - w.mobile.bind(p); - w.mobile.send({ type: "ready" }); - } + w.mobile = registerMobile(); + w.mobile.bind(p); + w.mobile.send({ type: "ready" }); w.isEditor = false; w.isLayout = true;