Change Phone Number notifications
This commit is contained in:
parent
4b82ac387b
commit
a001882d58
17 changed files with 277 additions and 39 deletions
|
@ -13,6 +13,7 @@ import {
|
|||
import { TimelineItemType } from '../../components/conversation/TimelineItem';
|
||||
import { PropsData } from '../../components/conversation/Message';
|
||||
import { PropsData as TimerNotificationProps } from '../../components/conversation/TimerNotification';
|
||||
import { PropsData as ChangeNumberNotificationProps } from '../../components/conversation/ChangeNumberNotification';
|
||||
import { PropsData as SafetyNumberNotificationProps } from '../../components/conversation/SafetyNumberNotification';
|
||||
import { PropsData as VerificationNotificationProps } from '../../components/conversation/VerificationNotification';
|
||||
import { PropsDataType as GroupsV2Props } from '../../components/conversation/GroupV2Change';
|
||||
|
@ -188,6 +189,12 @@ export function getPropsForBubble(
|
|||
data: null,
|
||||
};
|
||||
}
|
||||
if (isChangeNumberNotification(message)) {
|
||||
return {
|
||||
type: 'changeNumberNotification',
|
||||
data: getPropsForChangeNumberNotification(message, conversationSelector),
|
||||
};
|
||||
}
|
||||
if (isChatSessionRefreshed(message)) {
|
||||
return {
|
||||
type: 'chatSessionRefreshed',
|
||||
|
@ -852,6 +859,24 @@ export function isUniversalTimerNotification(
|
|||
return message.type === 'universal-timer-notification';
|
||||
}
|
||||
|
||||
// Change Number Notification
|
||||
|
||||
export function isChangeNumberNotification(
|
||||
message: MessageAttributesType
|
||||
): boolean {
|
||||
return message.type === 'change-number-notification';
|
||||
}
|
||||
|
||||
function getPropsForChangeNumberNotification(
|
||||
message: MessageAttributesType,
|
||||
conversationSelector: GetConversationByIdType
|
||||
): ChangeNumberNotificationProps {
|
||||
return {
|
||||
sender: conversationSelector(message.sourceUuid),
|
||||
timestamp: message.sent_at,
|
||||
};
|
||||
}
|
||||
|
||||
// Chat Session Refreshed
|
||||
|
||||
export function isChatSessionRefreshed(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue