mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-17 11:41:44 +00:00
fixed delete note not navigate to next note
This commit is contained in:
@@ -652,6 +652,7 @@ class NoteList extends React.Component {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
const dispatchHandler = () => {
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'DELETE_NOTE',
|
type: 'DELETE_NOTE',
|
||||||
@@ -659,7 +660,10 @@ class NoteList extends React.Component {
|
|||||||
noteKey: item.noteKey
|
noteKey: item.noteKey
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
ee.once('list:next', dispatchHandler)
|
||||||
})
|
})
|
||||||
|
.then(() => ee.emit('list:next'))
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error('Cannot Delete note: ' + err)
|
console.error('Cannot Delete note: ' + err)
|
||||||
})
|
})
|
||||||
@@ -683,6 +687,7 @@ class NoteList extends React.Component {
|
|||||||
})
|
})
|
||||||
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('EDIT_NOTE')
|
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('EDIT_NOTE')
|
||||||
})
|
})
|
||||||
|
.then(() => ee.emit('list:next'))
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error('Notes could not go to trash: ' + err)
|
console.error('Notes could not go to trash: ' + err)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user