Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: fix content in share ext editor takes too long to load

ammarahm-edc5db2e0ea9a9
diff --git a/apps/mobile/share/editor.js b/apps/mobile/share/editor.js
index 52ca2eb1e..433c3dc72 100644
--- a/apps/mobile/share/editor.js
+++ b/apps/mobile/share/editor.js
@@ -103,7 +103,7 @@ const useEditor = () => {
}
`
);
- }, 300);
+ }, 1);
};
return { ref, onLoad, currentNote, commands };
@@ -150,13 +150,6 @@ export const Editor = ({ onChange, onLoad }) => {
onLoad?.();
}, [onLoad]);
- useEffect(() => {
- setTimeout(() => {
- onLoad?.();
- setTimeout(() => setLoading(false));
- }, 1000);
- }, [onLoad]);
-
return (
<View
style={{
@@ -165,7 +158,13 @@ export const Editor = ({ onChange, onLoad }) => {
>
<WebView
ref={editor.ref}
- onLoad={editor.onLoad}
+ onLoad={() => {
+ editor.onLoad();
+ setTimeout(() => {
+ setLoading(false);
+ onLoad?.();
+ }, 1);
+ }}
nestedScrollEnabled
javaScriptEnabled={true}
focusable={true}