Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions app/views/ReadReceiptView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ class ReadReceiptView extends React.Component {
Message_TimeFormat, user: { id: userId, token }, baseUrl, theme
} = this.props;
const time = moment(item.ts).format(Message_TimeFormat);
if (!item?.user?.username) {
return null;
}
return (
<View style={[styles.itemContainer, { backgroundColor: themes[theme].backgroundColor }]}>
<Avatar
Expand All @@ -112,7 +115,7 @@ class ReadReceiptView extends React.Component {
<View style={styles.infoContainer}>
<View style={styles.item}>
<Text style={[styles.name, { color: themes[theme].titleText }]}>
{item.user.name}
{item?.user?.name}
</Text>
<Text style={{ color: themes[theme].auxiliaryText }}>
{time}
Expand Down Expand Up @@ -142,25 +145,23 @@ class ReadReceiptView extends React.Component {
return (
<SafeAreaView testID='read-receipt-view' theme={theme}>
<StatusBar theme={theme} />
<View>
{loading
? <ActivityIndicator theme={theme} />
: (
<FlatList
data={receipts}
renderItem={this.renderItem}
ItemSeparatorComponent={this.renderSeparator}
style={[
styles.list,
{
backgroundColor: themes[theme].chatComponentBackground,
borderColor: themes[theme].separatorColor
}
]}
keyExtractor={item => item._id}
/>
)}
</View>
{loading
? <ActivityIndicator theme={theme} />
: (
<FlatList
data={receipts}
renderItem={this.renderItem}
ItemSeparatorComponent={this.renderSeparator}
style={[
styles.list,
{
backgroundColor: themes[theme].chatComponentBackground,
borderColor: themes[theme].separatorColor
}
]}
keyExtractor={item => item._id}
/>
)}
</SafeAreaView>
);
}
Expand Down
3 changes: 1 addition & 2 deletions app/views/ReadReceiptView/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default StyleSheet.create({
padding: 10
},
list: {
...sharedStyles.separatorVertical,
marginVertical: 10
...sharedStyles.separatorVertical
}
});