Skip to content

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

fix locking and unlocking

ammarahm-ed77d201978d17
diff --git a/apps/mobile/src/components/NotesList/index.js b/apps/mobile/src/components/NotesList/index.js
index dac58f699..60065356f 100644
--- a/apps/mobile/src/components/NotesList/index.js
+++ b/apps/mobile/src/components/NotesList/index.js
@@ -194,7 +194,7 @@ export const NotesList = ({isGrouped = false}) => {
);
const _listKeyExtractor = (item, index) => item.id.toString();
-
+ console.log(notes);
return isGrouped && searchResults.length === 0 ? (
<SectionList
ref={ref => (sectionListRef = ref)}
diff --git a/apps/mobile/src/utils/storage.js b/apps/mobile/src/utils/storage.js
index 389c0db0c..31e4399b4 100644
--- a/apps/mobile/src/utils/storage.js
+++ b/apps/mobile/src/utils/storage.js
@@ -25,7 +25,7 @@ function encrypt(password, data) {
let key;
return Aes.pbkdf2('password', 'salt', 5000, 256).then(aes => {
key = aes;
-
+ console.log(aes);
return Aes.randomKey(16).then(iv => {
return Aes.encrypt(data, key, iv).then(cipher => ({
cipher,
diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.js
index 5c27a2b7e..0c0feaa0f 100755
--- a/apps/mobile/src/views/Editor/index.js
+++ b/apps/mobile/src/views/Editor/index.js
@@ -239,6 +239,7 @@ const Editor = ({navigation, noMenu}) => {
if (navigation && navigation.state.params && navigation.state.params.note) {
note = navigation.state.params.note;
+ console.log(navigation.state.params.note);
updateEditor();
} else if (note && note.id) {
updateEditor();
@@ -266,7 +267,9 @@ const Editor = ({navigation, noMenu}) => {
id = note.id;
dateEdited = note.dateEdited;
content = note.content;
- content.delta = await db.notes.note(id).delta();
+ if (!note.locked) {
+ content.delta = await db.notes.note(id).delta();
+ }
saveCounter = 0;
if (title !== null || title === '') {
@@ -290,7 +293,7 @@ const Editor = ({navigation, noMenu}) => {
});
} else if (note.content.delta) {
let delta;
-
+ console.log(note.content.delta, 'HERE');
if (typeof note.content.delta !== 'string') {
delta = note.content.delta;
} else {
@@ -528,6 +531,7 @@ const Editor = ({navigation, noMenu}) => {
content = null;
id = null;
timer = null;
+ note = {};
};
}, [noMenu]);