Skip to content

Commit 629d4a8

Browse files
committed
fixed delete note not navigate to next note
1 parent a6eddb5 commit 629d4a8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

browser/main/NoteList/index.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -652,14 +652,18 @@ class NoteList extends React.Component {
652652
})
653653
)
654654
.then((data) => {
655-
data.forEach((item) => {
656-
dispatch({
657-
type: 'DELETE_NOTE',
658-
storageKey: item.storageKey,
659-
noteKey: item.noteKey
655+
const dispatchHandler = () => {
656+
data.forEach((item) => {
657+
dispatch({
658+
type: 'DELETE_NOTE',
659+
storageKey: item.storageKey,
660+
noteKey: item.noteKey
661+
})
660662
})
661-
})
663+
}
664+
ee.once('list:next', dispatchHandler)
662665
})
666+
.then(() => ee.emit('list:next'))
663667
.catch((err) => {
664668
console.error('Cannot Delete note: ' + err)
665669
})
@@ -683,6 +687,7 @@ class NoteList extends React.Component {
683687
})
684688
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('EDIT_NOTE')
685689
})
690+
.then(() => ee.emit('list:next'))
686691
.catch((err) => {
687692
console.error('Notes could not go to trash: ' + err)
688693
})

0 commit comments

Comments
 (0)