Commit f3071049 authored by Cyrille Bollu's avatar Cyrille Bollu
Browse files

Do not navigate to last saved stack or first stack when refreshing a board


Signed-off-by: default avatarCyrille Bollu <cyrille@bollu.be>
parent d9256c57
Pipeline #457558 failed with stage
in 28 seconds
......@@ -21,7 +21,7 @@ class BoardDetails extends React.Component {
this.state = {
addingCard: false,
addingStack: false,
index: 0, // the index of the stack currently shown
index: null, // the index of the stack currently shown
newCardName: '',
newStackName: '',
refreshing: false,
......@@ -418,7 +418,7 @@ class BoardDetails extends React.Component {
// TODO: handle case where the remembered stackId has been deleted
if (resp.data.length > 0) {
this.setState({
index: this.props.route.params.stackId !== null ? parseInt(this.props.route.params.stackId) : resp.data[0].id,
index: (this.props.route.params.stackId !== null && this.state.index === null) ? parseInt(this.props.route.params.stackId) : this.state.index ?? resp.data[0].id,
})
}
......
......@@ -47,7 +47,6 @@ export const boardSlice = createSlice({
},
deleteStack: (state, action) => {
const stackIndex = state.value[action.payload.boardId].stacks.findIndex(stack => stack.id === action.payload.stackId)
console.log(`deleting stack with index$ {stackIndex}`)
delete state.value[action.payload.boardId].stacks.splice(stackIndex, 1)
},
moveCard: (state, action) => {
......
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