mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 08:32:39 +03:00
Merge f495a806c3
into release/next-js
This commit is contained in:
commit
c5d62a970e
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5a5a96460c864525f0a31cf5518bbc67f0b298fe637b461abdf4868ec5da83e6
|
||||
size 9537961
|
||||
oid sha256:b99c4ea8e73d810e4e8b515a662cdd36933affbed47c461fe4258dcdb3b656b1
|
||||
size 9601365
|
||||
|
@ -5,7 +5,7 @@
|
||||
/- glob
|
||||
/+ default-agent, verb, dbug
|
||||
|%
|
||||
++ hash 0v2.gfefu.pffjo.rphqi.mlmpu.smaq4
|
||||
++ hash 0v3.nmpms.bgjpu.9gd2j.klgii.qgeal
|
||||
+$ state-0 [%0 hash=@uv glob=(unit (each glob:glob tid=@ta))]
|
||||
+$ all-states
|
||||
$% state-0
|
||||
|
@ -24,6 +24,6 @@
|
||||
<div id="portal-root"></div>
|
||||
<script src="/~landscape/js/channel.js"></script>
|
||||
<script src="/~landscape/js/session.js"></script>
|
||||
<script src="/~landscape/js/bundle/index.34652264a0afd88428cd.js"></script>
|
||||
<script src="/~landscape/js/bundle/index.1010a94eb2978c30be9f.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -98,6 +98,10 @@ class ChatWindow extends Component<
|
||||
|
||||
calculateUnreadIndex() {
|
||||
const { graph, unreadCount } = this.props;
|
||||
const { state } = this;
|
||||
if(state.unreadIndex.neq(bigInt.zero)) {
|
||||
return;
|
||||
}
|
||||
const unreadIndex = graph.keys()[unreadCount];
|
||||
if (!unreadIndex || unreadCount === 0) {
|
||||
this.setState({
|
||||
@ -110,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 });
|
||||
}
|
||||
@ -126,6 +135,10 @@ class ChatWindow extends Component<
|
||||
|
||||
if(this.prevSize !== graphSize) {
|
||||
this.prevSize = graphSize;
|
||||
if(this.dismissedInitialUnread() &&
|
||||
this.virtualList?.startOffset() < 5) {
|
||||
this.dismissUnread();
|
||||
}
|
||||
if(this.state.unreadIndex.eq(bigInt.zero)) {
|
||||
this.calculateUnreadIndex();
|
||||
}
|
||||
@ -305,7 +318,8 @@ class ChatWindow extends Component<
|
||||
|
||||
return (
|
||||
<Col height='100%' overflow='hidden' position='relative'>
|
||||
<UnreadNotice
|
||||
{ !this.dismissedInitialUnread() &&
|
||||
(<UnreadNotice
|
||||
unreadCount={unreadCount}
|
||||
unreadMsg={
|
||||
unreadCount === 1 &&
|
||||
@ -316,7 +330,7 @@ class ChatWindow extends Component<
|
||||
}
|
||||
dismissUnread={this.dismissUnread}
|
||||
onClick={this.scrollToUnread}
|
||||
/>
|
||||
/>)}
|
||||
<VirtualScroller
|
||||
ref={(list) => {
|
||||
this.virtualList = list;
|
||||
|
Loading…
Reference in New Issue
Block a user