From a06e4498b9ba70df646c3ccf06414d361c136421 Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Tue, 23 Jul 2024 13:48:17 +0200 Subject: [PATCH] fix bugs --- dist/index.js | 18 +++++++++++++----- src/View/Modals/boardSettingsModal.tsx | 3 +++ src/ViewModel/Chat/chatViewModel.ts | 10 +++++++--- src/ViewModel/Pages/boardViewModel.ts | 8 ++++++++ src/ViewModel/Pages/settingsPageViewModel.ts | 5 ++--- 5 files changed, 33 insertions(+), 11 deletions(-) diff --git a/dist/index.js b/dist/index.js index e608c4b0..ba1074d1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1352,8 +1352,7 @@ ); this.encryptionKeyInput.callSubscriptions(); }; - setColor = (newColor) => { - this.color.value = newColor; + applyColor = (newColor) => { this.chatViewModel.setColor(newColor); }; remove = () => { @@ -1386,7 +1385,7 @@ () => this.encryptionKeyInput.value == this.chatViewModel.chatModel.info.encryptionKey ); this.color.subscribe((newColor) => { - this.setColor(newColor); + this.applyColor(newColor); }); } }; @@ -1423,6 +1422,9 @@ ); this.taskPageViewModel.updateBoard(newBoardInfoFileContent); }; + applyColor = (newColor) => { + this.taskPageViewModel.chatViewModel.setDisplayedColor(newColor); + }; // load loadListRelevantData = () => { this.name.value = this.boardInfo.name; @@ -1439,6 +1441,9 @@ [this.taskPageViewModel.selectedBoard], () => this.taskPageViewModel.selectedBoard.value == this ); + this.color.subscribeSilent((newColor) => { + this.applyColor(newColor); + }); } }; @@ -1534,9 +1539,12 @@ this.taskPageViewModel.closeBoard(); }; setColor = (color) => { - this.displayedColor.value = color; + this.setDisplayedColor(color); this.chatModel.setColor(color); }; + setDisplayedColor = (color) => { + this.displayedColor.value = color; + }; resetColor = () => { this.displayedColor.value = this.settingsPageViewModel.color.value; }; @@ -2049,7 +2057,7 @@ "on:enter": boardViewModel.saveSettings, "bind:value": boardViewModel.name } - )))), /* @__PURE__ */ createElement("button", { "on:click": boardViewModel.hideSettings }, translations.general.closeButton, /* @__PURE__ */ createElement("span", { class: "icon" }, "close")))); + ))), ColorPicker(boardViewModel.color)), /* @__PURE__ */ createElement("button", { "on:click": boardViewModel.hideSettings }, translations.general.closeButton, /* @__PURE__ */ createElement("span", { class: "icon" }, "close")))); } // src/View/ChatPages/boardPage.tsx diff --git a/src/View/Modals/boardSettingsModal.tsx b/src/View/Modals/boardSettingsModal.tsx index 9330f487..5a1d9998 100644 --- a/src/View/Modals/boardSettingsModal.tsx +++ b/src/View/Modals/boardSettingsModal.tsx @@ -1,6 +1,7 @@ import * as React from "bloatless-react"; import BoardViewModel from "../../ViewModel/Pages/boardViewModel"; +import { ColorPicker } from "../Components/colorPicker"; import { translations } from "../translations"; export function BoardSettingsModal(boardViewModel: BoardViewModel) { @@ -20,6 +21,8 @@ export function BoardSettingsModal(boardViewModel: BoardViewModel) { > + + {ColorPicker(boardViewModel.color)}