Skip to content

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

fix crash due to Toast

ammarahm-eda77da3cca979
diff --git a/apps/mobile/src/components/Dialog/index.js b/apps/mobile/src/components/Dialog/index.js
index 95f607482..8cf2acb25 100644
--- a/apps/mobile/src/components/Dialog/index.js
+++ b/apps/mobile/src/components/Dialog/index.js
@@ -44,7 +44,7 @@ export class Dialog extends Component {
history.selectedItemsList.forEach(async i => {
if (i.type === 'note') {
await db.notes.delete(i.id);
- ToastEvent.show('Notes moved to trash', 'error', 3000);
+ ToastEvent.show('Notes moved to trash', 'error');
updateEvent({type: i.type});
updateEvent({type: ACTIONS.PINNED});
} else if (i.type === 'topic') {
@@ -53,12 +53,12 @@ export class Dialog extends Component {
eSendEvent(eOnNewTopicAdded);
updateEvent({type: 'notebook'});
- ToastEvent.show('Topics deleted', 'error', 3000);
+ ToastEvent.show('Topics deleted', 'error');
} else if (i.type === 'notebook') {
await db.notebooks.delete(i.id);
updateEvent({type: i.type});
updateEvent({type: ACTIONS.PINNED});
- ToastEvent.show('Notebooks moved to trash', 'error', 3000);
+ ToastEvent.show('Notebooks moved to trash', 'error');
}
});
@@ -126,7 +126,6 @@ export class Dialog extends Component {
item.type.slice(1) +
' restored',
'success',
- 3000,
);
updateEvent({type: ACTIONS.TRASH});
diff --git a/apps/mobile/src/components/NotebookItem/index.js b/apps/mobile/src/components/NotebookItem/index.js
index 9418eef2e..9b3986fea 100644
--- a/apps/mobile/src/components/NotebookItem/index.js
+++ b/apps/mobile/src/components/NotebookItem/index.js
@@ -273,7 +273,7 @@ export const NotebookItem = ({
let noteIds = [];
selectedItemsList.forEach(item => noteIds.push(item.id));
- db.notes.move(
+ await db.notes.move(
{
topic: item.title,
id: item.notebookId,
@@ -284,13 +284,7 @@ export const NotebookItem = ({
moveNoteHideEvent();
- ToastEvent.show(
- `Note moved to ${item.title}`,
- 'success',
- 3000,
- () => {},
- '',
- );
+ ToastEvent.show(`Note moved to ${item.title}`, 'success');
}}
style={{
borderWidth: 1,