mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 04:48:00 +03:00
Merge pull request #3461 from tylershuster/the-thin-green-line
chat: hotfix new message indicator
This commit is contained in:
commit
5eb5d4abe1
@ -157,7 +157,7 @@ export class ChatWindow extends Component<ChatWindowProps, ChatWindowState> {
|
|||||||
if (!idle) {
|
if (!idle) {
|
||||||
idle = true;
|
idle = true;
|
||||||
}
|
}
|
||||||
} else if (idle) {
|
} else if (idle && (unreadCount === 0 || this.state.range.endIndex === 0)) {
|
||||||
idle = false;
|
idle = false;
|
||||||
}
|
}
|
||||||
this.setState({ idle });
|
this.setState({ idle });
|
||||||
@ -172,6 +172,10 @@ export class ChatWindow extends Component<ChatWindowProps, ChatWindowState> {
|
|||||||
if (!idle && prevProps.unreadCount !== unreadCount) {
|
if (!idle && prevProps.unreadCount !== unreadCount) {
|
||||||
this.virtualList.current?.scrollToIndex(mailboxSize);
|
this.virtualList.current?.scrollToIndex(mailboxSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!idle && envelopes.length !== prevProps.envelopes.length) {
|
||||||
|
this.virtualList.current?.scrollToIndex(mailboxSize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToUnread() {
|
scrollToUnread() {
|
||||||
@ -244,7 +248,7 @@ export class ChatWindow extends Component<ChatWindowProps, ChatWindowState> {
|
|||||||
<Fragment>
|
<Fragment>
|
||||||
<UnreadNotice
|
<UnreadNotice
|
||||||
unreadCount={unreadCount}
|
unreadCount={unreadCount}
|
||||||
unreadMsg={unreadMsg}
|
unreadMsg={this.state.idle ? unreadMsg : false}
|
||||||
dismissUnread={this.dismissUnread}
|
dismissUnread={this.dismissUnread}
|
||||||
onClick={this.scrollToUnread}
|
onClick={this.scrollToUnread}
|
||||||
/>
|
/>
|
||||||
@ -282,6 +286,7 @@ export class ChatWindow extends Component<ChatWindowProps, ChatWindowState> {
|
|||||||
isFirstUnread={
|
isFirstUnread={
|
||||||
unreadCount
|
unreadCount
|
||||||
&& mailboxSize - unreadCount === number
|
&& mailboxSize - unreadCount === number
|
||||||
|
&& this.state.idle
|
||||||
}
|
}
|
||||||
msg={msg}
|
msg={msg}
|
||||||
previousMsg={messages[number + 1]}
|
previousMsg={messages[number + 1]}
|
||||||
|
Loading…
Reference in New Issue
Block a user