stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
17 lines (13 loc) • 384 B
text/typescript
import { LocalMessage } from 'stream-chat';
import { MessageStatusTypes } from '../../../utils/utils';
export const getLastReceivedMessage = (messages: LocalMessage[]) => {
/**
* There are no status on dates so they will be skipped
*/
for (const message of messages) {
if (message?.status !== MessageStatusTypes.FAILED) {
return message;
}
}
return;
};