Skip to content

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

send focus info when required

ammarahm-ed121eac228b4a
diff --git a/apps/mobile/src/services/IntentService.js b/apps/mobile/src/services/IntentService.js
index 0b19ba53c..e79fe69b5 100644
--- a/apps/mobile/src/services/IntentService.js
+++ b/apps/mobile/src/services/IntentService.js
@@ -1,4 +1,4 @@
-import { Linking, NativeModules, Platform } from 'react-native';
+/* import {Linking, NativeModules, Platform} from 'react-native';
const {ReceiveSharingIntent} = NativeModules;
let currentIntent = null;
const isIos = Platform.OS === 'ios';
@@ -18,7 +18,6 @@ function getIntent() {
}
} else {
_data = await ReceiveSharingIntent.getFileNames();
-
}
} catch (e) {
reject(e);
@@ -39,14 +38,11 @@ function setIntent(d, resolve, reject) {
let delta = null;
if (weblink && text) {
- delta = [{insert: `${text + ' ' + weblink}`}];
- text = data.text + ' ' + data.weblink;
+ delta = [{insert: text}, {insert: weblink, attributes: {link: weblink}}];
} else if (text && !weblink) {
- delta = [{insert: `${text}`}];
- text = data.text;
+ delta = [{insert: text}];
} else if (weblink) {
- delta = [{insert: `${weblink}`}];
- text = weblink;
+ delta = [{insert: weblink, attributes: {link: weblink}}];
}
currentIntent = {
type: 'intent',
@@ -67,7 +63,6 @@ function check(callback) {
currentIntent = null;
}
-
const iosSortedData = (data) => {
let objects = {
filePath: null,
@@ -135,5 +130,5 @@ export default {
check,
setIntent,
iosSortedData,
-
};
+ */
\ No newline at end of file
diff --git a/apps/mobile/src/views/Editor/EditorHeader.js b/apps/mobile/src/views/Editor/EditorHeader.js
index 174896656..af0f140fe 100644
--- a/apps/mobile/src/views/Editor/EditorHeader.js
+++ b/apps/mobile/src/views/Editor/EditorHeader.js
@@ -89,6 +89,7 @@ const EditorHeader = () => {
}
await clearEditor();
Keyboard.removeListener('keyboardDidShow', () => {
+ editing.isFocused = true;
post('keyboard');
});
if (handleBack) {
diff --git a/apps/mobile/src/views/Editor/EditorRoot.js b/apps/mobile/src/views/Editor/EditorRoot.js
index 5c6d27619..8c260b8b9 100644
--- a/apps/mobile/src/views/Editor/EditorRoot.js
+++ b/apps/mobile/src/views/Editor/EditorRoot.js
@@ -66,6 +66,7 @@ const EditorRoot = () => {
await loadNote(item);
InteractionManager.runAfterInteractions(() => {
Keyboard.addListener('keyboardDidShow', () => {
+ editing.isFocused = true;
post('keyboard');
});
if (!DDS.isTab) {
@@ -127,6 +128,7 @@ const EditorRoot = () => {
}
await clearEditor();
Keyboard.removeListener('keyboardDidShow', () => {
+ editing.isFocused = true;
post('keyboard');
});
if (handleBack) {
diff --git a/apps/mobile/src/views/Editor/Functions.js b/apps/mobile/src/views/Editor/Functions.js
index db2b7c471..cc9cef4a6 100644
--- a/apps/mobile/src/views/Editor/Functions.js
+++ b/apps/mobile/src/views/Editor/Functions.js
@@ -238,9 +238,9 @@ export const _onMessage = async (evt) => {
case 'premium':
let user = await db.user.getUser();
if (user && !user.isEmailConfirmed) {
+ await sleep(500);
PremiumService.showVerifyEmailDialog();
} else {
- await sleep(300);
eSendEvent(eShowGetPremium, {
context: 'editor',
title: 'Get Notesnook Pro',
@@ -252,6 +252,9 @@ export const _onMessage = async (evt) => {
webviewInit = true;
loadNoteInEditor();
break;
+ case 'focus':
+ editing.focusType = message.value;
+ break;
default:
break;
}
@@ -292,9 +295,6 @@ export async function clearEditor() {
}
function checkIfContentIsSavable() {
- if (content.data.length === 0 && title === '') {
- return false;
- }
return true;
}
@@ -368,7 +368,7 @@ export async function saveNote() {
return;
}
let locked = id ? db.notes.note(id).data.locked : null;
- console.log(content.data,"DATA")
+ console.log(content.data, 'DATA');
let noteData = {
title,
content: {
diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.js
index 3d63416eb..1f8fef4b0 100644
--- a/apps/mobile/src/views/Settings/index.js
+++ b/apps/mobile/src/views/Settings/index.js
@@ -250,7 +250,7 @@ const AccoutLogoutSection = () => {
const [deleteAccount, setDeleteAccount] = useState(false);
return (
- !user && (
+ user && (
<>
{visible && (
<BaseDialog visible={true}>