fix bugs
This commit is contained in:
@@ -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) {
|
||||
></input>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
{ColorPicker(boardViewModel.color)}
|
||||
</main>
|
||||
<button on:click={boardViewModel.hideSettings}>
|
||||
{translations.general.closeButton}
|
||||
|
||||
@@ -39,12 +39,16 @@ export default class ChatViewModel {
|
||||
|
||||
closeSubPages = (): void => {
|
||||
this.taskPageViewModel.closeBoard();
|
||||
}
|
||||
};
|
||||
|
||||
setColor = (color: Color): void => {
|
||||
this.displayedColor.value = color;
|
||||
this.setDisplayedColor(color);
|
||||
this.chatModel.setColor(color);
|
||||
}
|
||||
};
|
||||
|
||||
setDisplayedColor = (color: Color): void => {
|
||||
this.displayedColor.value = color;
|
||||
};
|
||||
|
||||
resetColor = (): void => {
|
||||
this.displayedColor.value = this.settingsPageViewModel.color.value;
|
||||
|
||||
@@ -46,6 +46,10 @@ export default class BoardViewModel {
|
||||
this.taskPageViewModel.updateBoard(newBoardInfoFileContent);
|
||||
};
|
||||
|
||||
applyColor = (newColor: Color): void => {
|
||||
this.taskPageViewModel.chatViewModel.setDisplayedColor(newColor);
|
||||
};
|
||||
|
||||
// load
|
||||
loadListRelevantData = (): void => {
|
||||
this.name.value = this.boardInfo.name;
|
||||
@@ -68,5 +72,9 @@ export default class BoardViewModel {
|
||||
[this.taskPageViewModel.selectedBoard],
|
||||
() => this.taskPageViewModel.selectedBoard.value == this
|
||||
);
|
||||
|
||||
this.color.subscribeSilent((newColor) => {
|
||||
this.applyColor(newColor);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,8 +71,7 @@ export default class SettingsPageViewModel {
|
||||
this.encryptionKeyInput.callSubscriptions();
|
||||
};
|
||||
|
||||
setColor = (newColor: Color): void => {
|
||||
this.color.value = newColor;
|
||||
applyColor = (newColor: Color): void => {
|
||||
this.chatViewModel.setColor(newColor);
|
||||
};
|
||||
|
||||
@@ -121,7 +120,7 @@ export default class SettingsPageViewModel {
|
||||
);
|
||||
|
||||
this.color.subscribe((newColor) => {
|
||||
this.setColor(newColor);
|
||||
this.applyColor(newColor);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user