Skip to content

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

fix title does not load sometimes

ammarahm-ed486142a8befe
diff --git a/apps/mobile/src/views/Editor/Functions.js b/apps/mobile/src/views/Editor/Functions.js
index b400dc186..46b5a7336 100644
--- a/apps/mobile/src/views/Editor/Functions.js
+++ b/apps/mobile/src/views/Editor/Functions.js
@@ -201,19 +201,25 @@ export const loadNote = async (item) => {
checkStatus();
};
-const checkStatus = () => {
+const checkStatus = (reset = false) => {
webviewOK = false;
EditorWebView.current?.injectJavaScript(CHECK_STATUS());
clearTimeout(webviewTimer);
webviewTimer = setTimeout(() => {
if (!webviewOK) {
+ if (!reset) {
+ checkStatus(true);
+ console.log('checking again')
+ return;
+ }
webviewInit = false;
EditorWebView = createRef();
eSendEvent('webviewreset');
} else {
console.log('webview is running', webviewOK);
}
- }, 5000);
+
+ }, 3500);
};
export function setIntentNote(item) {
@@ -467,9 +473,7 @@ const loadNoteInEditor = async () => {
if (note?.id) {
tiny.call(EditorWebView, tiny.setTitle(title));
intent = false;
-
console.log(content.data);
-
tiny.call(EditorWebView, tiny.html(content.data));
setColors();
tiny.call(EditorWebView, tiny.updateDateEdited(timeConverter(note.dateEdited)));
diff --git a/apps/mobile/src/views/Editor/tiny/tiny.js b/apps/mobile/src/views/Editor/tiny/tiny.js
index 6e55b405e..507cbebbf 100644
--- a/apps/mobile/src/views/Editor/tiny/tiny.js
+++ b/apps/mobile/src/views/Editor/tiny/tiny.js
@@ -63,7 +63,7 @@ document.getElementById("titleInput").focus();
`;
const setTitle = (value) => `
-document.getElementById("titleInput").value = '${value}';
+document.getElementById("titleInput").value = \`${value}\`;
autosize();
`;