diff --git a/src/api/communicators.json b/src/api/communicators.json index c76acc5ed..840795576 100644 --- a/src/api/communicators.json +++ b/src/api/communicators.json @@ -7,6 +7,10 @@ "email": "support@cboard.io", "rootBoard": "root", "boards": ["root"], - "defaultBoardBlackList": [] + "defaultBoardBlackList": [], + "defaultBoardsIncluded": [ + { "nameOnJSON": "advanced", "homeBoard": "root" }, + { "nameOnJSON": "picSeePal", "homeBoard": "jjmlUcQs19" } + ] } ] diff --git a/src/components/Board/Board.actions.js b/src/components/Board/Board.actions.js index 9c11e2578..9e0990bb0 100644 --- a/src/components/Board/Board.actions.js +++ b/src/components/Board/Board.actions.js @@ -123,9 +123,12 @@ export function changeDefaultBoard(selectedBoardNameOnJson) { return initialDefaultBoardsIncluded; }; - const defaultBoardsIncluded = - activeCommunicator.defaultBoardsIncluded || - fallbackInitialDefaultBoardsIncluded(activeCommunicator); + const hasValidDefaultBoardsIncluded = !!activeCommunicator + .defaultBoardsIncluded?.length; + + const defaultBoardsIncluded = hasValidDefaultBoardsIncluded + ? activeCommunicator.defaultBoardsIncluded + : fallbackInitialDefaultBoardsIncluded(activeCommunicator); const defaultBoardsNamesIncluded = defaultBoardsIncluded?.map( includedBoardObject => includedBoardObject.nameOnJSON diff --git a/src/components/Communicator/Communicator.actions.js b/src/components/Communicator/Communicator.actions.js index 5dec5e3a0..f575f8afc 100644 --- a/src/components/Communicator/Communicator.actions.js +++ b/src/components/Communicator/Communicator.actions.js @@ -214,7 +214,10 @@ export function verifyAndUpsertCommunicator( updatedCommunicatorData.id = shortid.generate(); updatedCommunicatorData.boards = [...communicator.boards]; - if (!!communicator.defaultBoardsIncluded) { + const hasValidDefaultBoardsIncluded = !!communicator.defaultBoardsIncluded + ?.length; + + if (hasValidDefaultBoardsIncluded) { updatedCommunicatorData.defaultBoardsIncluded = communicator.defaultBoardsIncluded.map( item => ({ ...item }) ); diff --git a/src/components/Communicator/Communicator.reducer.js b/src/components/Communicator/Communicator.reducer.js index 5b19818b2..7c6ec7130 100644 --- a/src/components/Communicator/Communicator.reducer.js +++ b/src/components/Communicator/Communicator.reducer.js @@ -165,7 +165,11 @@ function communicatorReducer(state = initialState, action) { nameOnJSON: 'advanced', homeBoard: 'root' }; - const defaultBoardsIncluded = activeCommunicator.defaultBoardsIncluded + + const hasValidDefaultBoardsIncluded = !!activeCommunicator + .defaultBoardsIncluded?.length; + + const defaultBoardsIncluded = hasValidDefaultBoardsIncluded ? [ ...activeCommunicator.defaultBoardsIncluded, action.defaultBoardData