Skip to content

Commit

Permalink
fix(NoteList): fix router issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Antogin committed Jan 29, 2018
1 parent 4c2b233 commit d5da6de
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions browser/main/NoteList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand All @@ -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
}
})
})
}

Expand Down

0 comments on commit d5da6de

Please sign in to comment.