mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
fix(NoteList): fix router issue
This commit is contained in:
@@ -556,8 +556,9 @@ class NoteList extends React.Component {
|
|||||||
const notes = this.notes.map((note) => Object.assign({}, note))
|
const notes = this.notes.map((note) => Object.assign({}, note))
|
||||||
const selectedNotes = findNotesByKeys(notes, selectedNoteKeys)
|
const selectedNotes = findNotesByKeys(notes, selectedNoteKeys)
|
||||||
const firstNote = selectedNotes[0]
|
const firstNote = selectedNotes[0]
|
||||||
|
const eventName = firstNote.type === 'MARKDOWN_NOTE' ? 'ADD_MARKDOWN' : 'ADD_SNIPPET'
|
||||||
|
|
||||||
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_MARKDOWN')
|
AwsMobileAnalyticsConfig.recordDynamicCustomEvent(eventName)
|
||||||
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_ALLNOTE')
|
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_ALLNOTE')
|
||||||
dataApi
|
dataApi
|
||||||
.createNote(storage.key, {
|
.createNote(storage.key, {
|
||||||
@@ -571,18 +572,12 @@ class NoteList extends React.Component {
|
|||||||
type: 'UPDATE_NOTE',
|
type: 'UPDATE_NOTE',
|
||||||
note: note
|
note: note
|
||||||
})
|
})
|
||||||
let uniqueKey = note.storage + '-' + note.key
|
|
||||||
|
const uniqueKey = note.storage + '-' + note.key
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
selectedNoteKeys: [uniqueKey]
|
selectedNoteKeys: [uniqueKey]
|
||||||
})
|
})
|
||||||
|
|
||||||
router.push({
|
|
||||||
pathname: location.pathname,
|
|
||||||
query: {
|
|
||||||
key: uniqueKey
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user