1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Refactor getContextNotes()

This commit is contained in:
asmsuechan
2017-10-12 17:48:57 +09:00
parent da6b8c30a0
commit df3195fc1e
2 changed files with 13 additions and 22 deletions

View File

@@ -58,6 +58,7 @@ class TopBar extends React.Component {
}
handleKeyUp (e) {
const { router } = this.context
// reset states
this.setState({
isConfirmTranslation: false
@@ -68,7 +69,6 @@ class TopBar extends React.Component {
this.setState({
isConfirmTranslation: true
})
let { router } = this.context
router.push('/searched')
this.setState({
search: this.refs.searchInput.value
@@ -77,8 +77,8 @@ class TopBar extends React.Component {
}
handleSearchChange (e) {
const { router } = this.context
if (this.state.isAlphabet || this.state.isConfirmTranslation) {
let { router } = this.context
router.push('/searched')
} else {
e.preventDefault()