Skip to content

Commit

Permalink
backlog tab active after adding a task (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
bukinoshita committed Jan 5, 2018
1 parent 3da34e7 commit cc49548
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion renderer/pages/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Add extends Component {
const { title, description, project } = this.state

addTask({ title, description, project })
.then(() => Router.push('/start'))
.then(() => Router.push('/start?tab=Backlog'))
.catch(err => console.log(err))
}

Expand Down
5 changes: 4 additions & 1 deletion renderer/pages/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ class Home extends Component {
}

componentDidMount() {
const { url: { query: { tab } } } = this.props
const { user } = getUser()
this.setState({ user })
const tabSelected = tab ? tab : 'Today'

this.setState({ user, tabSelected })
}

selectTab(tabSelected) {
Expand Down

0 comments on commit cc49548

Please sign in to comment.