Skip to content

Commit

Permalink
Revert changes on toRootBoard function
Browse files Browse the repository at this point in the history
  • Loading branch information
RodriSanchez1 committed Jul 23, 2024
1 parent 78f1d91 commit bd01d09
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/components/Board/Board.actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,8 @@ export function previousBoard() {
}

export function toRootBoard() {
return (dispatch, getState) => {
const navHistory = getState().board.navHistory;
const firstBoardOnHistory = navHistory[0];
const allBoardsIds = getState().board.boards.map(board => board.id);

if (!firstBoardOnHistory || !allBoardsIds.includes(firstBoardOnHistory)) {
return null;
}
history.replace(`/board/${firstBoardOnHistory}`);
dispatch({
type: TO_ROOT_BOARD
});
return firstBoardOnHistory;
return {
type: TO_ROOT_BOARD
};
}

Expand Down

0 comments on commit bd01d09

Please sign in to comment.