mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
fix crash due to Toast
This commit is contained in:
@@ -44,7 +44,7 @@ export class Dialog extends Component {
|
|||||||
history.selectedItemsList.forEach(async i => {
|
history.selectedItemsList.forEach(async i => {
|
||||||
if (i.type === 'note') {
|
if (i.type === 'note') {
|
||||||
await db.notes.delete(i.id);
|
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: i.type});
|
||||||
updateEvent({type: ACTIONS.PINNED});
|
updateEvent({type: ACTIONS.PINNED});
|
||||||
} else if (i.type === 'topic') {
|
} else if (i.type === 'topic') {
|
||||||
@@ -53,12 +53,12 @@ export class Dialog extends Component {
|
|||||||
eSendEvent(eOnNewTopicAdded);
|
eSendEvent(eOnNewTopicAdded);
|
||||||
updateEvent({type: 'notebook'});
|
updateEvent({type: 'notebook'});
|
||||||
|
|
||||||
ToastEvent.show('Topics deleted', 'error', 3000);
|
ToastEvent.show('Topics deleted', 'error');
|
||||||
} else if (i.type === 'notebook') {
|
} else if (i.type === 'notebook') {
|
||||||
await db.notebooks.delete(i.id);
|
await db.notebooks.delete(i.id);
|
||||||
updateEvent({type: i.type});
|
updateEvent({type: i.type});
|
||||||
updateEvent({type: ACTIONS.PINNED});
|
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) +
|
item.type.slice(1) +
|
||||||
' restored',
|
' restored',
|
||||||
'success',
|
'success',
|
||||||
3000,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
updateEvent({type: ACTIONS.TRASH});
|
updateEvent({type: ACTIONS.TRASH});
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ export const NotebookItem = ({
|
|||||||
let noteIds = [];
|
let noteIds = [];
|
||||||
selectedItemsList.forEach(item => noteIds.push(item.id));
|
selectedItemsList.forEach(item => noteIds.push(item.id));
|
||||||
|
|
||||||
db.notes.move(
|
await db.notes.move(
|
||||||
{
|
{
|
||||||
topic: item.title,
|
topic: item.title,
|
||||||
id: item.notebookId,
|
id: item.notebookId,
|
||||||
@@ -284,13 +284,7 @@ export const NotebookItem = ({
|
|||||||
|
|
||||||
moveNoteHideEvent();
|
moveNoteHideEvent();
|
||||||
|
|
||||||
ToastEvent.show(
|
ToastEvent.show(`Note moved to ${item.title}`, 'success');
|
||||||
`Note moved to ${item.title}`,
|
|
||||||
'success',
|
|
||||||
3000,
|
|
||||||
() => {},
|
|
||||||
'',
|
|
||||||
);
|
|
||||||
}}
|
}}
|
||||||
style={{
|
style={{
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user