mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +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 selectedNotes = findNotesByKeys(notes, selectedNoteKeys)
|
||||
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')
|
||||
dataApi
|
||||
.createNote(storage.key, {
|
||||
@@ -571,18 +572,12 @@ class NoteList extends React.Component {
|
||||
type: 'UPDATE_NOTE',
|
||||
note: note
|
||||
})
|
||||
let uniqueKey = note.storage + '-' + note.key
|
||||
|
||||
const uniqueKey = note.storage + '-' + note.key
|
||||
|
||||
this.setState({
|
||||
selectedNoteKeys: [uniqueKey]
|
||||
})
|
||||
|
||||
router.push({
|
||||
pathname: location.pathname,
|
||||
query: {
|
||||
key: uniqueKey
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user