Skip to content

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

combine multiple calls into one

ammarahm-ed589772ac5fab
diff --git a/apps/mobile/src/components/sheetprovider/index.js b/apps/mobile/src/components/sheetprovider/index.js
index ddcb7d6e8..53494e84e 100644
--- a/apps/mobile/src/components/sheetprovider/index.js
+++ b/apps/mobile/src/components/sheetprovider/index.js
@@ -46,8 +46,7 @@ const SheetProvider = ({ context = 'global' }) => {
if (data.editor) {
editor.current.refocus = false;
if (editing.keyboardState) {
- tiny.call(EditorWebView, tiny.cacheRange);
- tiny.call(EditorWebView, tiny.blur);
+ tiny.call(EditorWebView, tiny.cacheRange + tiny.blur);
editor.current.refocus = true;
}
}
@@ -63,8 +62,7 @@ const SheetProvider = ({ context = 'global' }) => {
if (editor.current.refocus) {
editing.isFocused = true;
await reFocusEditor();
- tiny.call(EditorWebView, tiny.restoreRange);
- tiny.call(EditorWebView, tiny.clearRange);
+ tiny.call(EditorWebView, tiny.restoreRange + tiny.clearRange);
editor.current.refocus = false;
}
}
diff --git a/apps/mobile/src/screens/editor/Functions.js b/apps/mobile/src/screens/editor/Functions.js
index 9bacb530b..03f7e5859 100644
--- a/apps/mobile/src/screens/editor/Functions.js
+++ b/apps/mobile/src/screens/editor/Functions.js
@@ -313,8 +313,7 @@ export const loadNote = async item => {
}
requestedReload = true;
updateSessionStatus();
- tiny.call(EditorWebView, tiny.notLoading);
- tiny.call(EditorWebView, tiny.toogleReadMode('design'));
+ tiny.call(EditorWebView, tiny.notLoading + tiny.toogleReadMode('design'));
} else {
if (id === item.id && !item.forced) {
console.log('note is already opened in editor');
@@ -1001,8 +1000,10 @@ const loadNoteInEditor = async (keepHistory = true) => {
}
setColors();
- tiny.call(EditorWebView, tiny.updateDateEdited(timeConverter(note.dateEdited)));
- tiny.call(EditorWebView, tiny.updateSavingState('Saved'));
+ tiny.call(
+ EditorWebView,
+ tiny.updateDateEdited(timeConverter(note.dateEdited)) + tiny.updateSavingState('Saved')
+ );
} else {
tiny.call(EditorWebView, tiny.toogleReadMode('design'));
await restoreEditorState();
diff --git a/apps/mobile/src/screens/editor/tiny/toolbar/commands.js b/apps/mobile/src/screens/editor/tiny/toolbar/commands.js
index ab91112bf..f8089aaf5 100644
--- a/apps/mobile/src/screens/editor/tiny/toolbar/commands.js
+++ b/apps/mobile/src/screens/editor/tiny/toolbar/commands.js
@@ -30,7 +30,7 @@ export const execCommands = {
indent: `tinymce.activeEditor.execCommand('Indent');`,
outdent: `tinymce.activeEditor.execCommand('Outdent');`,
blockquote: `tinymce.activeEditor.execCommand('mceBlockQuote');`,
- link: link => `tinymce.activeEditor.execCommand('mceInsertLink',false, '${link}');`,
+ link: link => `tinymce.activeEditor.execCommand('mceInsertLink',false, "${link}");`,
unlink: `tinymce.activeEditor.execCommand('Unlink')`,
fontsize: size => `tinymce.activeEditor.execCommand('FontSize', false, '${size}');`,
removeformat: `tinymce.activeEditor.execCommand('RemoveFormat');`,