Adds a check to ensure that the URL view belongs to the board or redirects (#1468)
* Adds a check to ensure that the URL view belongs to the board or redirects * Fix linter
This commit is contained in:
parent
ee3f00858a
commit
85ccc051ec
1 changed files with 2 additions and 1 deletions
|
@ -110,7 +110,8 @@ const BoardPage = (props: Props): JSX.Element => {
|
|||
}
|
||||
|
||||
Utils.log(`attachToBoard: ${boardId}`)
|
||||
if (!viewId && boardViews.length > 0) {
|
||||
const viewIsFromBoard = boardViews.some((view) => view.id === viewId)
|
||||
if ((!viewId || !viewIsFromBoard) && boardViews.length > 0) {
|
||||
const newPath = generatePath(match.path, {...match.params, boardId, viewId: boardViews[0].id})
|
||||
history.replace(newPath)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue