Multiple person typing indicators in groups
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import memoizee from 'memoizee';
|
||||
import { head, sortBy } from 'lodash';
|
||||
import { sortBy } from 'lodash';
|
||||
import type { ConversationModel } from '../models/conversations';
|
||||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
import type { ConversationAttributesType } from '../model-types';
|
||||
@@ -77,8 +77,11 @@ function sortConversationTitles(
|
||||
// `ATTRIBUTES_THAT_DONT_INVALIDATE_PROPS_CACHE`, remove it from that list.
|
||||
export function getConversation(model: ConversationModel): ConversationType {
|
||||
const { attributes } = model;
|
||||
const typingValues = Object.values(model.contactTypingTimers || {});
|
||||
const typingMostRecent = head(sortBy(typingValues, 'timestamp'));
|
||||
const typingValues = sortBy(
|
||||
Object.values(model.contactTypingTimers || {}),
|
||||
'timestamp'
|
||||
);
|
||||
const typingContactIds = typingValues.map(({ senderId }) => senderId);
|
||||
|
||||
const ourAci = window.textsecure.storage.user.getAci();
|
||||
const ourPni = window.textsecure.storage.user.getPni();
|
||||
@@ -219,7 +222,7 @@ export function getConversation(model: ConversationModel): ConversationType {
|
||||
timestamp: dropNull(timestamp),
|
||||
title: getTitle(attributes),
|
||||
titleNoDefault: getTitleNoDefault(attributes),
|
||||
typingContactId: typingMostRecent?.senderId,
|
||||
typingContactIds,
|
||||
searchableTitle: isMe(attributes)
|
||||
? window.i18n('icu:noteToSelf')
|
||||
: getTitle(attributes),
|
||||
|
Reference in New Issue
Block a user