From 662deb17a682496e50af2e4ec018af048cefd3a7 Mon Sep 17 00:00:00 2001 From: Rodri Sanchez Date: Mon, 15 Jul 2024 16:33:02 -0300 Subject: [PATCH] Use an absolute path on history replace --- src/components/Board/Board.actions.js | 4 ++-- src/components/Communicator/Communicator.actions.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Board/Board.actions.js b/src/components/Board/Board.actions.js index 9e0990bb0..a84764f1e 100644 --- a/src/components/Board/Board.actions.js +++ b/src/components/Board/Board.actions.js @@ -284,7 +284,7 @@ export function toRootBoard() { if (!firstBoardOnHistory || !allBoardsIds.includes(firstBoardOnHistory)) { return null; } - history.replace(firstBoardOnHistory); + history.replace(`/board/${firstBoardOnHistory}`); dispatch({ type: TO_ROOT_BOARD }); @@ -888,7 +888,7 @@ export function removeBoardsFromList(blacklist = [], rootBoard) { return (dispatch, getState) => { const actualBoardId = getState().board.activeBoardId; if (blacklist.includes(actualBoardId)) { - history.replace(rootBoard); + history.replace(`/board/${rootBoard}`); dispatch(switchBoard(rootBoard)); const rootBoardFinded = dispatch(toRootBoard()); if (!rootBoardFinded || blacklist.includes(rootBoard)) return; diff --git a/src/components/Communicator/Communicator.actions.js b/src/components/Communicator/Communicator.actions.js index f575f8afc..aa817b10e 100644 --- a/src/components/Communicator/Communicator.actions.js +++ b/src/components/Communicator/Communicator.actions.js @@ -396,7 +396,7 @@ export function syncCommunicators(remoteCommunicators) { const newActiveCommunicator = getActiveCommunicator(getState); const rootBoard = newActiveCommunicator.rootBoard; dispatch(switchBoard(rootBoard)); - history.replace(rootBoard); + history.replace(`/board/${rootBoard}`); } }; }