Skip to content

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

gracefully load content

ammarahm-ed4dfc8431d2f9
diff --git a/apps/mobile/html/Web.bundle/site/listeners.js b/apps/mobile/html/Web.bundle/site/listeners.js
index 8396f2956..cdb3b254d 100755
--- a/apps/mobile/html/Web.bundle/site/listeners.js
+++ b/apps/mobile/html/Web.bundle/site/listeners.js
@@ -120,7 +120,7 @@ function isInvalidValue(value) {
function updateInfoBar() {
let ids = ['infodate', 'infosaved'];
- ids.forEach(function(id) {
+ ids.forEach(function (id) {
let element = document.getElementById(id);
if (!element) return;
if (element.textContent && element.textContent !== '') {
@@ -158,7 +158,21 @@ function attachMessageListener() {
tinymce.activeEditor.mode.set('readonly');
if (!isInvalidValue(value)) {
tinymce.activeEditor.setHTML(value);
- reactNativeEventHandler('noteLoaded', true);
+ let timeout = 0;
+ if (value.length > 400000) {
+ timeout = 900;
+ }else if (value.length > 300000) {
+ timeout = 600;
+ } else if (value.length > 200000) {
+ timeout = 450;
+ } else if (value.length > 100000) {
+ timeout = 300;
+ } else if (value.length > 50000) {
+ timeout = 150;
+ }
+ setTimeout(() => {
+ reactNativeEventHandler('noteLoaded', true);
+ }, timeout);
globalThis.isClearingNoteData = false;
setTimeout(function () {
tinymce.activeEditor.undoManager.transact(function () {});
diff --git a/apps/mobile/src/views/Editor/Functions.js b/apps/mobile/src/views/Editor/Functions.js
index c646d816f..27273b553 100644
--- a/apps/mobile/src/views/Editor/Functions.js
+++ b/apps/mobile/src/views/Editor/Functions.js
@@ -475,7 +475,6 @@ export const _onMessage = async evt => {
break;
case 'selectionvalue':
eSendEvent('selectionvalue', message.value);
- console.log(message.value);
break;
case 'history':
eSendEvent('historyEvent', message.value);