Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New root board is created when change the featured board #1720

Closed
RodriSanchez1 opened this issue Jun 25, 2024 · 0 comments · Fixed by #1727
Closed

New root board is created when change the featured board #1720

RodriSanchez1 opened this issue Jun 25, 2024 · 0 comments · Fixed by #1727
Labels
Milestone

Comments

@RodriSanchez1
Copy link
Collaborator

This occurs when a user creates a new API communicator, logs in on another device, and changes the featured board. If the new communicator was created in the database without a defaultIncludedBoards value, that would be an empty array.

At the time of changing the featured board, we do this comprobation:

const defaultBoardsIncluded =
      activeCommunicator.defaultBoardsIncluded  //here we have a wrong truthy value 
      ||  fallbackInitialDefaultBoardsIncluded(activeCommunicator);

This causes the loss of the current root board on the user communicator

To be able to fix this bug, we need to add an exhaustive comprobation of the defaultIncludedBoards prop.

Suggestions:

const isValid = (activeCommunicator.defaultBoardsIncluded && activeCommunicator.defaultBoardsIncluded.length > 0) ? true : false;
//or
const isValid = !!(activeCommunicator.defaultBoardsIncluded && activeCommunicator.defaultBoardsIncluded.length);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants