finish changes to chat color setting

This commit is contained in:
marlon-erler
2026-09-26 15:27:39 +02:00
parent 64e32a99aa
commit 82d69a48f0
5 changed files with 17 additions and 4 deletions
@@ -19,6 +19,7 @@ export default class SettingsPageViewModel extends Context {
);
color: React.State<Colors> = new React.State<any>(Colors.Standard);
appliedColor: React.State<Colors> = new React.State<any>(Colors.Standard);
// guards
cannotSetPrimaryChannel: React.State<boolean> = React.createProxyState(
@@ -27,6 +28,11 @@ export default class SettingsPageViewModel extends Context {
this.nameInput.value == "" ||
this.nameInput.value == this.name.value,
);
cannotSetColor: React.State<boolean> = React.createProxyState(
[this.color, this.appliedColor],
() =>
this.color.value == this.appliedColor.value,
);
cannotAddSecondaryChannel: React.State<boolean> = React.createProxyState(
[this.newSecondaryChannelInput],
() => this.newSecondaryChannelInput.value == "",
@@ -73,6 +79,7 @@ export default class SettingsPageViewModel extends Context {
applyColor = (): void => {
this.chatViewModel.setColor(this.color.value);
this.appliedColor.value = this.color.value;
};
remove = (): void => {
@@ -87,6 +94,7 @@ export default class SettingsPageViewModel extends Context {
this.chatViewModel.chatModel.info.name;
this.color.value = this.chatViewModel.chatModel.color;
this.appliedColor.value = this.color.value;
};
updateData = (): void => {