Commit 16f62c91 authored by Cyrille Bollu's avatar Cyrille Bollu
Browse files

Merge branch 'fix/24-card-drop-current-stack' into 'master'

Board: Fix moving of cards unpredictable after first move

See merge request !8
parents f17544dd 31dbe2bf
Pipeline #451941 passed with stage
in 34 seconds
......@@ -67,12 +67,18 @@ class BoardDetails extends React.Component {
}
// Gets the board's details from the server and setup the page's header bar
componentDidMount() {
this.loadBoard()
async componentDidMount() {
this.props.navigation.setOptions({
headerTitle: 'Board details',
headerRight: () => (<AppMenu/>)
})
await this.loadBoard()
// Shows stack with order === 0, if stacks are available
if (this.props.boards.value[this.props.route.params.boardId].stacks?.length) {
this.setState({
index: this.props.boards.value[this.props.route.params.boardId].stacks[0].id,
})
}
}
render() {
......@@ -269,12 +275,6 @@ class BoardDetails extends React.Component {
stack
})
})
// Shows stack with order === 0, if stacks are available
if (this.props.boards.value[this.props.route.params.boardId].stacks?.length) {
this.setState({
index: this.props.boards.value[this.props.route.params.boardId].stacks[0].id,
})
}
})
}
......@@ -298,6 +298,8 @@ class BoardDetails extends React.Component {
.then(() => {
// TODO check for error
console.log('card moved')
// Refresh board
return this.loadBoard()
})
.catch(() => {
// Reverts change and inform user
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment