mirror of
https://github.com/urbit/shrub.git
synced 2024-12-23 19:05:48 +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() {
|
handleWindowBlur() {
|
||||||
this.setState({ idle: true });
|
this.setState({ idle: true });
|
||||||
}
|
}
|
||||||
@ -130,6 +135,10 @@ class ChatWindow extends Component<
|
|||||||
|
|
||||||
if(this.prevSize !== graphSize) {
|
if(this.prevSize !== graphSize) {
|
||||||
this.prevSize = graphSize;
|
this.prevSize = graphSize;
|
||||||
|
if(this.dismissedInitialUnread()
|
||||||
|
&& this.virtualList?.startOffset() === 0) {
|
||||||
|
this.dismissUnread();
|
||||||
|
}
|
||||||
if(this.state.unreadIndex.eq(bigInt.zero)) {
|
if(this.state.unreadIndex.eq(bigInt.zero)) {
|
||||||
this.calculateUnreadIndex();
|
this.calculateUnreadIndex();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user