mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 08:32:39 +03:00
ChatWindow: dismiss unread if we are at bottom of window
This commit is contained in:
parent
0f674aab17
commit
1a03b0c63f
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user