fix empty note creation

This commit is contained in:
ammarahm-ed
2020-04-11 12:16:05 +05:00
parent 7a6c186959
commit 41df9483e7
2 changed files with 24 additions and 21 deletions

View File

@@ -128,7 +128,7 @@ const MergeEditor = () => {
};
const onMessageFromPrimaryWebView = evt => {
alert('helloworld');
if (evt.nativeEvent.data !== '') {
let data = JSON.parse(evt.nativeEvent.data);
primaryDelta = data.delta;

View File

@@ -249,6 +249,9 @@ const Editor = ({noMenu}) => {
const saveNote = async (lockNote = true) => {
if (!canSave) return;
if (!title && !content) return;
if (content && content.text.trim().length === 0 && title && title.trim().length == 0) return;
if (!content && title && title.trim().length === 0) return;
if (!title && content && content.text.trim.length === 0) return;
if (!content) {
content = {
text: '',