consider board ids for selection
This commit is contained in:
@@ -69,8 +69,9 @@ export default class BoardViewModel {
|
||||
this.loadListRelevantData();
|
||||
|
||||
this.isSelected = React.createProxyState(
|
||||
[this.taskPageViewModel.selectedBoard],
|
||||
() => this.taskPageViewModel.selectedBoard.value == this
|
||||
[this.taskPageViewModel.selectedBoardId],
|
||||
() =>
|
||||
this.taskPageViewModel.selectedBoardId.value == this.boardInfo.fileId
|
||||
);
|
||||
|
||||
this.color.subscribeSilent((newColor) => {
|
||||
|
||||
@@ -22,8 +22,8 @@ export default class TaskPageViewModel {
|
||||
|
||||
boardViewModels: React.MapState<BoardViewModel> = new React.MapState();
|
||||
|
||||
selectedBoard: React.State<BoardViewModel | undefined> = new React.State<
|
||||
BoardViewModel | undefined
|
||||
selectedBoardId: React.State<string | undefined> = new React.State<
|
||||
string | undefined
|
||||
>(undefined);
|
||||
|
||||
// guards
|
||||
@@ -64,12 +64,12 @@ export default class TaskPageViewModel {
|
||||
};
|
||||
|
||||
selectBoard = (boardViewModel: BoardViewModel): void => {
|
||||
this.selectedBoard.value = boardViewModel;
|
||||
this.selectedBoardId.value = boardViewModel.boardInfo.fileId;
|
||||
this.chatViewModel.displayedColor.value = boardViewModel.color.value;
|
||||
};
|
||||
|
||||
closeBoard = (): void => {
|
||||
this.selectedBoard.value = undefined;
|
||||
this.selectedBoardId.value = undefined;
|
||||
this.chatViewModel.resetColor();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user