fix: restored getMessageExpirationProps

pull/2861/head
William Grant 2 years ago
parent a3fd9a8a96
commit 20e1895a50

@ -9,11 +9,8 @@ import { CONVERSATION } from '../session/constants';
import { PubKey } from '../session/types';
import { UserUtils } from '../session/utils';
import { StateType } from '../state/reducer';
import { getMessageReactsProps } from '../state/selectors/conversations';
import {
getMessageExpirationProps,
isPrivateAndFriend,
} from '../state/selectors/selectedConversation';
import { getMessageReactsProps, getMessageExpirationProps } from '../state/selectors/conversations';
import { isPrivateAndFriend } from '../state/selectors/selectedConversation';
export function useAvatarPath(convoId: string | undefined) {
const convoProps = useConversationPropsById(convoId);

@ -10,6 +10,7 @@ import {
MessageModelPropsWithConvoProps,
MessageModelPropsWithoutConvoProps,
MessagePropsDetails,
PropsForExpiringMessage,
PropsForQuote,
QuoteLookupType,
ReduxConversationType,
@ -871,6 +872,29 @@ export const getMessageAttachmentProps = createSelector(getMessagePropsByMessage
return msgProps;
});
export const getMessageExpirationProps = createSelector(getMessagePropsByMessageId, (props):
| PropsForExpiringMessage
| undefined => {
if (!props || isEmpty(props)) {
return undefined;
}
const msgProps: PropsForExpiringMessage = {
...pick(props.propsForMessage, [
'convoId',
'direction',
'receivedAt',
'isUnread',
'expirationTimestamp',
'expirationLength',
'isExpired',
]),
messageId: props.propsForMessage.id,
};
return msgProps;
});
export const getIsMessageSelected = createSelector(
getMessagePropsByMessageId,
getSelectedMessageIds,

Loading…
Cancel
Save