From 64e32a99aa590c8bbec369729bae1f115e977d0a Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Sat, 26 Sep 2026 15:19:05 +0200 Subject: [PATCH] immediately apply changes to chat info --- src/ViewModel/Chat/chatViewModel.ts | 2 +- src/ViewModel/Pages/settingsPageViewModel.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ViewModel/Chat/chatViewModel.ts b/src/ViewModel/Chat/chatViewModel.ts index 2dd177cc..934ad951 100644 --- a/src/ViewModel/Chat/chatViewModel.ts +++ b/src/ViewModel/Chat/chatViewModel.ts @@ -189,7 +189,7 @@ export default class ChatViewModel extends ContextHost { this.messagePageViewModel.handleReaction(reaction); }, ); - chatModel.changeHandlerManager.setHandler(this.chatModel.id, this.settingsPageViewModel.preloadData); + chatModel.changeHandlerManager.setHandler(this.chatModel.id, this.settingsPageViewModel.updateData); // load this.loadPageSelection(); diff --git a/src/ViewModel/Pages/settingsPageViewModel.ts b/src/ViewModel/Pages/settingsPageViewModel.ts index c2c90392..61968c63 100644 --- a/src/ViewModel/Pages/settingsPageViewModel.ts +++ b/src/ViewModel/Pages/settingsPageViewModel.ts @@ -85,10 +85,16 @@ export default class SettingsPageViewModel extends Context { preloadData = (): void => { this.name.value = this.chatViewModel.chatModel.info.name; - + this.color.value = this.chatViewModel.chatModel.color; }; + updateData = (): void => { + this.preloadData(); + this.nameInput.value = this.name.value; + this.chatViewModel.resetColor(); + } + loadData = (): void => { this.nameInput.value = this.name.value;