From b80c59e00e9f3823081525899e4b8bfca5d27865 Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Tue, 9 Jul 2024 18:58:05 +0200 Subject: [PATCH] improve ui --- dist/index.js | 6 ++++-- src/Model/chatModel.ts | 2 ++ src/Views/threadView.tsx | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 29134a2b..73a8f2c7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -386,9 +386,10 @@ this.primaryChannel, this.composingMessage, this.isSubscribed, - isConnected + isConnected, + senderName ], - () => this.primaryChannel.value == "" || this.composingMessage.value == "" || this.isSubscribed.value == false || isConnected.value == false + () => this.primaryChannel.value == "" || this.composingMessage.value == "" || senderName.value == "" || this.isSubscribed.value == false || isConnected.value == false ); this.cannotAddSecondaryChannel = createProxyState( [this.newSecondaryChannelName], @@ -919,6 +920,7 @@ if (scrollFromBottom > 400) return; listElement.scrollTop = listElement.scrollHeight; }); + setTimeout(() => listElement.scrollTop = listElement.scrollHeight, 50); return listElement; } diff --git a/src/Model/chatModel.ts b/src/Model/chatModel.ts index db099017..df950993 100644 --- a/src/Model/chatModel.ts +++ b/src/Model/chatModel.ts @@ -67,10 +67,12 @@ export class Chat { this.composingMessage, this.isSubscribed, isConnected, + senderName, ], () => this.primaryChannel.value == "" || this.composingMessage.value == "" || + senderName.value == "" || this.isSubscribed.value == false || isConnected.value == false ); diff --git a/src/Views/threadView.tsx b/src/Views/threadView.tsx index 8bde7c32..81395623 100644 --- a/src/Views/threadView.tsx +++ b/src/Views/threadView.tsx @@ -70,8 +70,9 @@ export function ThreadView(chat: Chat) { listElement.scrollHeight - (listElement.scrollTop + listElement.offsetHeight); if (scrollFromBottom > 400) return; - + listElement.scrollTop = listElement.scrollHeight; }); + setTimeout(() => (listElement.scrollTop = listElement.scrollHeight), 50); return listElement; }