fix(message): add robust NaN validation for date handling across components
Add comprehensive date validation using Number.isNaN() checks to prevent crashes when timestamps are invalid or empty. Apply defensive formatting across CommentItem, SystemMessageItem, MessageBubble, LongPressMenu, and store utilities. Refine message bubble styling: move sender name display to both sides in group chat with distinct `mySenderName` styling, adjust bubble corner radius to top-right for consistent arrow placement, and align message rows to flex-start for improved layout. Simplify group avatar rendering in ConversationListRow.
This commit is contained in:
@@ -223,14 +223,7 @@ function createConversationRowStyles(colors: AppColors) {
|
||||
width: 56,
|
||||
height: 56,
|
||||
},
|
||||
groupAvatarPlaceholder: {
|
||||
width: 56,
|
||||
height: 56,
|
||||
borderRadius: borderRadius.md,
|
||||
backgroundColor: colors.primary.main,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
|
||||
timeText: {
|
||||
color: colors.text.hint,
|
||||
fontSize: 12,
|
||||
@@ -324,13 +317,7 @@ const ConversationListRowInner: React.FC<ConversationListRowProps> = ({
|
||||
</View>
|
||||
) : isGroupChat ? (
|
||||
<View style={styles.groupAvatar}>
|
||||
{displayAvatar ? (
|
||||
<Avatar source={displayAvatar} size={56} name={displayName} />
|
||||
) : (
|
||||
<View style={styles.groupAvatarPlaceholder}>
|
||||
<MaterialCommunityIcons name="account-group" size={28} color={colors.primary.contrast} />
|
||||
</View>
|
||||
)}
|
||||
<Avatar source={displayAvatar} size={56} name={displayNameRaw || '群'} />
|
||||
</View>
|
||||
) : (
|
||||
<Avatar source={displayAvatar} size={56} name={displayName} />
|
||||
|
||||
Reference in New Issue
Block a user