ConversationView: Improve types

This commit is contained in:
Scott Nonnenberg 2021-08-30 14:32:56 -07:00 committed by GitHub
parent c765d3202c
commit dcf29078f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 1101 additions and 941 deletions

View file

@ -27,7 +27,7 @@ import {
type ExternalProps = {
id: string;
onClickQuotedMessage: (id?: string) => unknown;
onClickQuotedMessage: (id: string) => unknown;
};
const mapStateToProps = (state: StateType, props: ExternalProps) => {
@ -92,8 +92,12 @@ const mapStateToProps = (state: StateType, props: ExternalProps) => {
ourConversationId: getUserConversationId(state),
})
: undefined,
onClickQuotedMessage: () =>
onClickQuotedMessage(quotedMessage?.quote?.messageId),
onClickQuotedMessage: () => {
const messageId = quotedMessage?.quote?.messageId;
if (messageId) {
onClickQuotedMessage(messageId);
}
},
// Emojis
recentEmojis,
skinTone: get(state, ['items', 'skinTone'], 0),