1
0
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:
Georges Indrianjafy
2018-01-29 09:13:09 +02:00
parent 4c2b233722
commit d5da6de86c

View File

@@ -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
}
})
})
}