ChatWindow: dismiss unread if we are at bottom of window
@@ -114,6 +114,11 @@ class ChatWindow extends Component<
});
}
+ dismissedInitialUnread() {
+ const { unreadCount, graph } = this.props;
+ return this.state.unreadIndex.neq(graph.keys()?.[unreadCount]?.[0] ?? bigInt.zero)
+ }
+
handleWindowBlur() {
this.setState({ idle: true });
}
@@ -130,6 +135,10 @@ class ChatWindow extends Component<
if(this.prevSize !== graphSize) {
this.prevSize = graphSize;
+ if(this.dismissedInitialUnread()
+ && this.virtualList?.startOffset() === 0) {
+ this.dismissUnread();
+ }
if(this.state.unreadIndex.eq(bigInt.zero)) {
this.calculateUnreadIndex();
}
