Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion browser/main/Detail/MarkdownNoteDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ class MarkdownNoteDetail extends React.Component {
}

render () {
const { data, location, config } = this.props
const { data, dispatch, location, config } = this.props
const { note, editorType } = this.state
const storageKey = note.storage
const folderKey = note.folder
Expand Down Expand Up @@ -465,6 +465,7 @@ class MarkdownNoteDetail extends React.Component {
saveTagsAlphabetically={config.ui.saveTagsAlphabetically}
showTagsAlphabetically={config.ui.showTagsAlphabetically}
data={data}
dispatch={dispatch}
onChange={this.handleUpdateTag.bind(this)}
coloredTags={config.coloredTags}
/>
Expand Down
3 changes: 2 additions & 1 deletion browser/main/Detail/SnippetNoteDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ class SnippetNoteDetail extends React.Component {
}

render () {
const { data, config, location } = this.props
const { data, dispatch, config, location } = this.props
const { note } = this.state

const storageKey = note.storage
Expand Down Expand Up @@ -823,6 +823,7 @@ class SnippetNoteDetail extends React.Component {
saveTagsAlphabetically={config.ui.saveTagsAlphabetically}
showTagsAlphabetically={config.ui.showTagsAlphabetically}
data={data}
dispatch={dispatch}
onChange={(e) => this.handleChange(e)}
coloredTags={config.coloredTags}
/>
Expand Down
13 changes: 7 additions & 6 deletions browser/main/Detail/TagSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
import i18n from 'browser/lib/i18n'
import ee from 'browser/main/lib/eventEmitter'
import Autosuggest from 'react-autosuggest'
import { push } from 'connected-react-router'

class TagSelect extends React.Component {
constructor (props) {
Expand Down Expand Up @@ -96,8 +97,11 @@ class TagSelect extends React.Component {
}

handleTagLabelClick (tag) {
const { router } = this.context
router.push(`/tags/${tag}`)
const { dispatch } = this.props

// Note: `tag` requires encoding later.
// E.g. % in tag is a problem (see issue #3170) - encodeURIComponent(tag) is not working.
dispatch(push(`/tags/${tag}`))
}

handleTagRemoveButtonClick (tag) {
Expand Down Expand Up @@ -255,11 +259,8 @@ class TagSelect extends React.Component {
}
}

TagSelect.contextTypes = {
router: PropTypes.shape({})
}

TagSelect.propTypes = {
dispatch: PropTypes.func,
className: PropTypes.string,
value: PropTypes.arrayOf(PropTypes.string),
onChange: PropTypes.func,
Expand Down