Skip to content

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

add trash

ammarahm-ed865ec89e917c
diff --git a/apps/mobile/src/components/ActionSheetComponent/index.js b/apps/mobile/src/components/ActionSheetComponent/index.js
index 34e344c88..4abe78d67 100644
--- a/apps/mobile/src/components/ActionSheetComponent/index.js
+++ b/apps/mobile/src/components/ActionSheetComponent/index.js
@@ -344,6 +344,8 @@ export const ActionSheetComponent = ({
} else {
noteColors.push(color);
}
+
+ //db.notes.note(note.id).
// TODO
/* db.addNote({
dateCreated: note.dateCreated,
diff --git a/apps/mobile/src/components/AddNotebookDialog/index.js b/apps/mobile/src/components/AddNotebookDialog/index.js
index 09e6a07a0..cc56de293 100644
--- a/apps/mobile/src/components/AddNotebookDialog/index.js
+++ b/apps/mobile/src/components/AddNotebookDialog/index.js
@@ -112,7 +112,6 @@ export class AddNotebookDialog extends React.Component {
let id = toEdit && toEdit.id ? toEdit.id : null;
- // TODO
await db.notebooks.add({
title: this.title,
description: this.description,
diff --git a/apps/mobile/src/components/Dialog/index.js b/apps/mobile/src/components/Dialog/index.js
index 77ec39b15..2049b5ee9 100644
--- a/apps/mobile/src/components/Dialog/index.js
+++ b/apps/mobile/src/components/Dialog/index.js
@@ -60,9 +60,7 @@ export class Dialog extends Component {
break;
}
case dialogActions.ACTION_EMPTY_TRASH: {
- // TODO
- //await db.clearTrash();
-
+ await db.trash.clear();
updateEvent({type: ACTIONS.TRASH});
ToastEvent.show('Trash cleared', 'error', 1000, () => {}, '');
this.setState({
@@ -79,8 +77,7 @@ export class Dialog extends Component {
});
}
case dialogActions.ACTION_TRASH: {
- // TODO
- //db.restoreItem(item.dateCreated);
+ db.trash.restore(item.id);
ToastEvent.show(
item.type.slice(0, 1).toUpperCase() +
item.type.slice(1) +
@@ -98,6 +95,7 @@ export class Dialog extends Component {
let {template, item} = this.props;
if (dialogActions.ACTION_TRASH === template.action) {
// delete item forever.
+ db.trash.delete(item.id);
}
this.setState({
visible: false,
diff --git a/apps/mobile/src/provider/reducer.js b/apps/mobile/src/provider/reducer.js
index cd67d2b01..624fb7d66 100644
--- a/apps/mobile/src/provider/reducer.js
+++ b/apps/mobile/src/provider/reducer.js
@@ -26,8 +26,8 @@ export const reducer = (state, action) => {
};
}
case ACTIONS.TRASH: {
- let trash = [];
- // TODO
+ let trash = db.trash.all;
+
return {
...state,
trash: trash,
diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.js
index 379c1de74..26ac68303 100755
--- a/apps/mobile/src/views/Editor/index.js
+++ b/apps/mobile/src/views/Editor/index.js
@@ -194,7 +194,6 @@ const Editor = ({navigation, noMenu}) => {
if (id) {
let lockednote = db.notes.note(id);
if (lockNote && lockednote.locked) {
- // TODO
await db.notes.note(id).lock('password');
}
}