From b575892075010e3412ac40cc952b960aaaf34d5a Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Tue, 23 Jul 2024 13:53:50 +0200 Subject: [PATCH] update color when change synced --- dist/index.js | 9 +++++---- src/ViewModel/Pages/boardViewModel.ts | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 63ed8887..993c8c41 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1422,8 +1422,8 @@ ); this.taskPageViewModel.updateBoard(newBoardInfoFileContent); }; - applyColor = (newColor) => { - this.taskPageViewModel.chatViewModel.setDisplayedColor(newColor); + applyColor = () => { + this.taskPageViewModel.chatViewModel.setDisplayedColor(this.color.value); }; // load loadListRelevantData = () => { @@ -1441,8 +1441,9 @@ [this.taskPageViewModel.selectedBoardId], () => this.taskPageViewModel.selectedBoardId.value == this.boardInfo.fileId ); - this.color.subscribeSilent((newColor) => { - this.applyColor(newColor); + this.color.subscribe(() => { + if (this.isSelected.value == false) return; + this.applyColor(); }); } }; diff --git a/src/ViewModel/Pages/boardViewModel.ts b/src/ViewModel/Pages/boardViewModel.ts index 1fd69d61..df636835 100644 --- a/src/ViewModel/Pages/boardViewModel.ts +++ b/src/ViewModel/Pages/boardViewModel.ts @@ -46,8 +46,8 @@ export default class BoardViewModel { this.taskPageViewModel.updateBoard(newBoardInfoFileContent); }; - applyColor = (newColor: Color): void => { - this.taskPageViewModel.chatViewModel.setDisplayedColor(newColor); + applyColor = (): void => { + this.taskPageViewModel.chatViewModel.setDisplayedColor(this.color.value); }; // load @@ -74,8 +74,9 @@ export default class BoardViewModel { this.taskPageViewModel.selectedBoardId.value == this.boardInfo.fileId ); - this.color.subscribeSilent((newColor) => { - this.applyColor(newColor); + this.color.subscribe(() => { + if (this.isSelected.value == false) return; + this.applyColor(); }); } }