From a806f6813a8640b2383121060a506dffd5153c5e Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Wed, 9 Nov 2022 11:21:14 +0500 Subject: [PATCH] mobile: reconnect messaging when app reloads --- apps/mobile/app/screens/editor/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/mobile/app/screens/editor/index.tsx b/apps/mobile/app/screens/editor/index.tsx index b6db06631..aead7268e 100755 --- a/apps/mobile/app/screens/editor/index.tsx +++ b/apps/mobile/app/screens/editor/index.tsx @@ -121,8 +121,12 @@ const Editor = React.memo( const onError = useCallback(() => { editor.setLoading(true); console.log("loading editor"); + if (useGeckoView) { + //@ts-ignore + editor.ref?.connectMessagingPort(); + } setTimeout(() => editor.setLoading(false), 10); - }, [editor]); + }, [editor, useGeckoView]); useEffect(() => { eSubscribeEvent("webview_reset", onError);