Skip to content

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

change some timers to make sure action sheet is presented in editor

ammarahm-edf437291af6a6
diff --git a/apps/mobile/src/components/ProgressDialog/index.js b/apps/mobile/src/components/ProgressDialog/index.js
index b2bcc6d57..87b686d3f 100644
--- a/apps/mobile/src/components/ProgressDialog/index.js
+++ b/apps/mobile/src/components/ProgressDialog/index.js
@@ -141,6 +141,7 @@ const ProgressDialog = () => {
dialogData?.actionsArray.map(item => (
<Button
onPress={item.action}
+ key={item.accentText}
title={item.actionText}
icon={item.icon && item.icon}
type="accent"
diff --git a/apps/mobile/src/views/Editor/EditorHeader.js b/apps/mobile/src/views/Editor/EditorHeader.js
index 7ffe2e8fd..1347ee45a 100644
--- a/apps/mobile/src/views/Editor/EditorHeader.js
+++ b/apps/mobile/src/views/Editor/EditorHeader.js
@@ -49,7 +49,7 @@ import {
textInput
} from './Functions';
import HistoryComponent from './HistoryComponent';
-import tiny, { safeKeyboardDismiss } from './tiny/tiny';
+import tiny, {safeKeyboardDismiss} from './tiny/tiny';
import {toolbarRef} from './tiny/toolbar/constants';
const EditorHeader = () => {
@@ -144,7 +144,7 @@ const EditorHeader = () => {
});
return;
}
- console.log(editing.isFocused)
+ console.log(editing.isFocused);
if (editing.isFocused) {
safeKeyboardDismiss();
await sleep(300);
@@ -155,12 +155,11 @@ const EditorHeader = () => {
const showActionsheet = async () => {
let note = getNote() && db.notes.note(getNote().id).data;
- if (editing.isFocused) {
+ if (editing.isFocused || editing.keyboardState) {
safeKeyboardDismiss();
- await sleep(500);
editing.isFocused = true;
}
-
+ await sleep(500);
let android = Platform.OS === 'android' ? ['PinToNotif'] : [];
ActionSheetEvent(note, true, true, [
'Add to notebook',
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/commands.js b/apps/mobile/src/views/Editor/tiny/toolbar/commands.js
index ef080ac51..280958276 100644
--- a/apps/mobile/src/views/Editor/tiny/toolbar/commands.js
+++ b/apps/mobile/src/views/Editor/tiny/toolbar/commands.js
@@ -7,7 +7,7 @@ import {
} from '../../../../utils/Events';
import {sleep} from '../../../../utils/TimeUtils';
import {EditorWebView} from '../../Functions';
-import tiny from '../tiny';
+import tiny, { safeKeyboardDismiss } from '../tiny';
import {formatSelection} from './constants';
export const execCommands = {
@@ -78,8 +78,8 @@ export const execCommands = {
cl: `tinymce.activeEditor.execCommand('insertCheckList')`,
image: async () => {
if (editing.isFocused) {
- tiny.call(EditorWebView, tiny.blur);
- await sleep(300);
+ safeKeyboardDismiss()
+ await sleep(500);
editing.isFocused = true;
}
eSendEvent(eOpenProgressDialog, {
@@ -89,7 +89,7 @@ export const execCommands = {
{
action: async () => {
eSendEvent(eCloseProgressDialog);
- await sleep(300);
+ await sleep(500);
launchCamera(
{
includeBase64: true,
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/item.js b/apps/mobile/src/views/Editor/tiny/toolbar/item.js
index 1abe11ce4..7d30c7ab4 100644
--- a/apps/mobile/src/views/Editor/tiny/toolbar/item.js
+++ b/apps/mobile/src/views/Editor/tiny/toolbar/item.js
@@ -193,7 +193,7 @@ const ToolbarItem = ({
if (user && !user.isEmailConfirmed) {
if (editing.isFocused) {
safeKeyboardDismiss();
- await sleep(300);
+ await sleep(500);
editing.isFocused = true;
}
PremiumService.showVerifyEmailDialog();
@@ -209,7 +209,7 @@ const ToolbarItem = ({
if (type === 'settings') {
if (editing.isFocused) {
safeKeyboardDismiss();
- await sleep(300);
+ await sleep(500);
editing.isFocused = true;
}
eSendEvent('openEditorSettings');