Skip to content

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

fully implemented vault system.

ammarahm-edf7d4f87c2ebd
diff --git a/apps/mobile/src/components/NoteItem/index.js b/apps/mobile/src/components/NoteItem/index.js
index e9c3fa53d..b72ee664d 100644
--- a/apps/mobile/src/components/NoteItem/index.js
+++ b/apps/mobile/src/components/NoteItem/index.js
@@ -1,8 +1,6 @@
import React, {useState} from 'react';
import {View, Text, TouchableOpacity, Dimensions} from 'react-native';
-
import {COLOR_SCHEME, SIZE, br, ph, pv, WEIGHT} from '../../common/common';
-
import Icon from 'react-native-vector-icons/Feather';
import {
timeSince,
@@ -188,19 +186,23 @@ const NoteItem = props => {
}}>
{!props.isTrash ? (
<>
- <Icon
- style={{width: 30}}
- name="lock"
- size={SIZE.xs}
- color={colors.icon}
- />
- <Icon
- style={{width: 30}}
- name="star"
- size={SIZE.xs}
- color={colors.icon}
- />
+ {item.locked ? (
+ <Icon
+ style={{width: 30}}
+ name="lock"
+ size={SIZE.xs}
+ color={colors.icon}
+ />
+ ) : null}
+ {item.favorite ? (
+ <Icon
+ style={{width: 30}}
+ name="star"
+ size={SIZE.xs}
+ color={colors.icon}
+ />
+ ) : null}
<Text
style={{
color: colors.icon,
@@ -208,7 +210,7 @@ const NoteItem = props => {
textAlignVertical: 'center',
fontFamily: WEIGHT.regular,
}}>
- {timeSince(item.dateCreated) + ' '}
+ {timeSince(item.dateCreated)}
</Text>
</>
) : null}
@@ -342,7 +344,6 @@ const NoteItem = props => {
hideMenu();
NavigationService.push('Folders', {
note: item,
-
title: 'Choose Notebook',
isMove: true,
hideMore: true,
diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.js
index e40434068..388cd933a 100755
--- a/apps/mobile/src/views/Editor/index.js
+++ b/apps/mobile/src/views/Editor/index.js
@@ -64,13 +64,14 @@ const Editor = ({navigation}) => {
}
};
- const saveNote = async (noteProps = {}, lockNote = false) => {
+ const saveNote = async (noteProps = {}, lockNote = true) => {
if (!content) {
content = {
text: '',
delta: null,
};
}
+ console.log(content.text, timestamp, title);
timestamp = await db.addNote({
tags: noteProps.tags,
@@ -85,9 +86,8 @@ const Editor = ({navigation}) => {
},
dateCreated: timestamp,
});
-
+ console.log(db.getNote(timestamp));
if (lockNote && noteProps.locked) {
- console.log(noteProps, timestamp);
db.lockNote(timestamp, 'password');
}
};
@@ -96,7 +96,6 @@ const Editor = ({navigation}) => {
post(JSON.stringify(colors));
if (navigation.state.params && navigation.state.params.note) {
note = navigation.state.params.note;
-
updateEditor();
}
};
@@ -119,7 +118,6 @@ const Editor = ({navigation}) => {
timestamp = note.dateCreated;
content = note.content;
}, 200);
- console.log(note);
};
const onTitleTextChange = value => {
@@ -242,11 +240,13 @@ const Editor = ({navigation}) => {
}}
onMessage={evt => {
if (evt.nativeEvent.data !== '') {
+ clearTimeout(timer);
timer = null;
onChange(evt.nativeEvent.data);
timer = setTimeout(() => {
saveNote(noteProps, true);
- }, 2000);
+ console.log('saved');
+ }, 1000);
}
}}
/>
@@ -265,26 +265,12 @@ const Editor = ({navigation}) => {
return () => {
handleBack.remove();
handleBack = null;
- };
- }, []);
-
- useEffect(() => {
- console.log('hello');
- updateInterval = setInterval(async function() {
- await saveNote(noteProps);
- }, 2000);
-
- return () => {
- saveNote(noteProps, true);
- clearInterval(updateInterval);
- updateInterval = null;
- console.log('yeah');
title = null;
content = null;
timer = null;
timestamp = null;
};
- }, [noteProps]);
+ }, []);
useEffect(() => {
return () => {
@@ -320,8 +306,10 @@ const Editor = ({navigation}) => {
setDialog(false);
}}
positivePress={() => {
- navigation.goBack();
- setDialog(false);
+ setTimeout(() => {
+ navigation.goBack();
+ setDialog(false);
+ }, 1000);
}}
/>
{_renderEditor()}
@@ -338,8 +326,6 @@ const Editor = ({navigation}) => {
noteProps={noteProps}
updateProps={props => {
setNoteProps(props);
-
- console.log(props, noteProps);
}}
close={() => {
setTimeout(() => {
diff --git a/apps/mobile/src/views/Folders/index.js b/apps/mobile/src/views/Folders/index.js
index 9ffacff92..374f31f20 100644
--- a/apps/mobile/src/views/Folders/index.js
+++ b/apps/mobile/src/views/Folders/index.js
@@ -517,7 +517,6 @@ export const Folders = ({navigation}) => {
width: '90%',
marginHorizontal: '5%',
paddingHorizontal: ph,
-
paddingVertical: pv + 5,
flexDirection: 'row',
justifyContent: 'flex-start',
@@ -529,10 +528,10 @@ export const Folders = ({navigation}) => {
<Text
style={{
fontSize: SIZE.md,
- fontFamily: WEIGHT.semibold,
+ fontFamily: WEIGHT.regular,
color: 'white',
}}>
- {' '} Create a new notebook
+ {' '}Create a new notebook
</Text>
</TouchableOpacity>
</KeyboardAvoidingView>
diff --git a/apps/mobile/src/views/Trash/index.js b/apps/mobile/src/views/Trash/index.js
index e53a97610..811cff43c 100644
--- a/apps/mobile/src/views/Trash/index.js
+++ b/apps/mobile/src/views/Trash/index.js
@@ -33,6 +33,7 @@ export const Trash = ({navigation}) => {
<FlatList
numColumns={1}
+ keyExtractor={item => item.dateCreated.toString()}
style={{
width: '100%',
alignSelf: 'center',