You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			27 lines
		
	
	
		
			654 B
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			27 lines
		
	
	
		
			654 B
		
	
	
	
		
			TypeScript
		
	
| import { LastMessageStatusType } from '../state/ducks/conversations';
 | |
| 
 | |
| interface ConversationLastMessageUpdate {
 | |
|   lastMessage: string;
 | |
|   lastMessageStatus: LastMessageStatusType;
 | |
| }
 | |
| 
 | |
| export const createLastMessageUpdate = ({
 | |
|   lastMessageStatus,
 | |
|   lastMessageNotificationText,
 | |
| }: {
 | |
|   lastMessageStatus?: LastMessageStatusType;
 | |
|   lastMessageNotificationText?: string;
 | |
| }): ConversationLastMessageUpdate => {
 | |
|   if (!lastMessageNotificationText) {
 | |
|     return {
 | |
|       lastMessage: '',
 | |
|       lastMessageStatus: undefined,
 | |
|     };
 | |
|   }
 | |
| 
 | |
|   return {
 | |
|     lastMessage: lastMessageNotificationText || '',
 | |
|     lastMessageStatus: lastMessageStatus || undefined,
 | |
|   };
 | |
| };
 |