diff --git a/pkg/interface/src/views/apps/chat/components/lib/chat-window.tsx b/pkg/interface/src/views/apps/chat/components/lib/chat-window.tsx index b5ca26c32..9cfd6d2d8 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/chat-window.tsx +++ b/pkg/interface/src/views/apps/chat/components/lib/chat-window.tsx @@ -157,7 +157,7 @@ export class ChatWindow extends Component { if (!idle) { idle = true; } - } else if (idle) { + } else if (idle && (unreadCount === 0 || this.state.range.endIndex === 0)) { idle = false; } this.setState({ idle }); @@ -172,6 +172,10 @@ export class ChatWindow extends Component { if (!idle && prevProps.unreadCount !== unreadCount) { this.virtualList.current?.scrollToIndex(mailboxSize); } + + if (!idle && envelopes.length !== prevProps.envelopes.length) { + this.virtualList.current?.scrollToIndex(mailboxSize); + } } scrollToUnread() { @@ -244,7 +248,7 @@ export class ChatWindow extends Component { @@ -282,6 +286,7 @@ export class ChatWindow extends Component { isFirstUnread={ unreadCount && mailboxSize - unreadCount === number + && this.state.idle } msg={msg} previousMsg={messages[number + 1]}