Scroll to bottom of conversation on message send

This commit is contained in:
Scott Nonnenberg 2021-11-02 19:00:54 -07:00 committed by GitHub
parent 254c87a1ac
commit 5bd7eda124
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 107 additions and 21 deletions

View file

@ -824,6 +824,7 @@ export function _conversationMessagesSelector(
messageIds,
metrics,
resetCounter,
scrollToBottomCounter,
scrollToMessageId,
scrollToMessageCounter,
} = conversation;
@ -862,7 +863,7 @@ export function _conversationMessagesSelector(
isLoadingMessages,
loadCountdownStart,
items,
isNearBottom,
isNearBottom: isNearBottom || false,
messageHeightChangeIndex:
isNumber(messageHeightChangeIndex) && messageHeightChangeIndex >= 0
? messageHeightChangeIndex
@ -872,6 +873,7 @@ export function _conversationMessagesSelector(
? oldestUnreadIndex
: undefined,
resetCounter,
scrollToBottomCounter,
scrollToIndex:
isNumber(scrollToIndex) && scrollToIndex >= 0 ? scrollToIndex : undefined,
scrollToIndexCounter: scrollToMessageCounter,
@ -907,10 +909,16 @@ export const getConversationMessagesSelector = createSelector(
haveNewest: false,
haveOldest: false,
isLoadingMessages: false,
isNearBottom: false,
items: [],
loadCountdownStart: undefined,
messageHeightChangeIndex: undefined,
oldestUnreadIndex: undefined,
resetCounter: 0,
scrollToBottomCounter: 0,
scrollToIndex: undefined,
scrollToIndexCounter: 0,
totalUnread: 0,
items: [],
};
}