Skip to content

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

check params

ammarahm-eda0f58fd887d1
diff --git a/apps/mobile/src/views/Notes/index.js b/apps/mobile/src/views/Notes/index.js
index 82af10c32..c96c46505 100644
--- a/apps/mobile/src/views/Notes/index.js
+++ b/apps/mobile/src/views/Notes/index.js
@@ -81,10 +81,9 @@ export const Notes = ({route, navigation}) => {
}
let allNotes = [];
if (params.type === 'tag') {
- allNotes = db.notes.tagged(params.tag.id);
+ allNotes = db.notes.tagged(params.tag?.id);
} else if (params.type === 'color') {
- allNotes = db.notes.colored(params.color.id);
- console.log('allNotes', allNotes);
+ allNotes = db.notes.colored(params.color?.id);
} else {
allNotes = db.notebooks
.notebook(params.notebookId)
@@ -108,27 +107,27 @@ export const Notes = ({route, navigation}) => {
color: params.type == 'color' ? COLORS_NOTE[params.title] : null,
},
});
+ });
- if (!pageIsLoaded) {
- pageIsLoaded = true;
- return;
- }
+ if (!pageIsLoaded) {
+ pageIsLoaded = true;
+ return;
+ }
- Navigation.setHeaderState('Notes', params, {
- heading:
- params.type === 'tag'
- ? '#' + params.title
- : params.title.slice(0, 1).toUpperCase() + params.title.slice(1),
- id:
- params.type === 'tag'
- ? params.tag.id
- : params.type === 'topic'
- ? params.id
- : params.type === 'color'
- ? params.color.id
- : null,
- type: params.type,
- });
+ Navigation.setHeaderState('Notes', params, {
+ heading:
+ params.type === 'tag'
+ ? '#' + params.title
+ : params.title.slice(0, 1).toUpperCase() + params.title.slice(1),
+ id:
+ params.type === 'tag'
+ ? params.tag.id
+ : params.type === 'topic'
+ ? params.id
+ : params.type === 'color'
+ ? params.color.id
+ : null,
+ type: params.type,
});
};
@@ -223,7 +222,7 @@ export const Notes = ({route, navigation}) => {
paragraph: 'You have not added any notes yet.',
button: 'Add your First Note',
action: _onPressBottomButton,
- loading:'Loading your notes.'
+ loading: 'Loading your notes.',
}}
/>
<ContainerBottomButton