mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
Merge branch 'main' of github.com:anyproto/anytype-ts
This commit is contained in:
commit
1935e97820
1 changed files with 12 additions and 4 deletions
|
@ -583,6 +583,9 @@ const BlockChat = observer(class BlockChat extends React.Component<I.BlockCompon
|
|||
|
||||
onScroll (e: any) {
|
||||
const { isPopup } = this.props;
|
||||
const rootId = this.getRootId();
|
||||
const subId = this.getSubId();
|
||||
const { lastStateId } = S.Chat.getState(subId);
|
||||
const node = $(this.node);
|
||||
const scrollWrapper = node.find('#scrollWrapper');
|
||||
const formWrapper = node.find('#formWrapper');
|
||||
|
@ -618,11 +621,16 @@ const BlockChat = observer(class BlockChat extends React.Component<I.BlockCompon
|
|||
};
|
||||
});
|
||||
|
||||
this.top = st;
|
||||
this.scrolledItems = this.scrolledItems.concat(this.getMessagesInViewport().filter(it => !it.isRead).map(it => ({ id: it.id, orderId: it.orderId })));
|
||||
const read = (item) => {
|
||||
const { id, orderId } = item;
|
||||
|
||||
window.clearTimeout(this.timeoutScrollStop);
|
||||
this.timeoutScrollStop = window.setTimeout(() => this.onReadStop(), 100);
|
||||
S.Chat.setReadStatus(subId, [ id ], true);
|
||||
C.ChatReadMessages(rootId, orderId, orderId, lastStateId);
|
||||
};
|
||||
|
||||
this.getMessagesInViewport().filter(it => !it.isRead).forEach(item => read(item));
|
||||
|
||||
this.top = st;
|
||||
|
||||
Preview.tooltipHide(true);
|
||||
Preview.previewHide(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue