Skip to content

Commit

Permalink
hot-fix: remove the wrong condition make the app throw at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
sherlockvn authored and hoangdat committed Dec 9, 2023
1 parent 80ffbb9 commit 014be33
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions lib/pages/chat/events/message/message_content_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ class MessageContentBuilder extends StatelessWidget {
context,
maxWidth: availableBubbleContraints.maxWidth,
ownMessage: event.isOwnMessage,
hideDisplayName: nextEvent != null &&
event.hideDisplayName(
nextEvent!,
),
hideDisplayName: event.hideDisplayName(
nextEvent,
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ class MessageContentWithTimestampBuilder extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
nextEvent != null &&
event.hideDisplayName(nextEvent!) ||
event.hideDisplayName(nextEvent) ||
event.hideDisplayNameInBubbleChat
? const SizedBox()
: DisplayNameWidget(
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/matrix_sdk_extensions/event_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ extension LocalizedBody on Event {
MessageTypes.File,
}.contains(messageType);

bool hideDisplayName(Event nextEvent) =>
bool hideDisplayName(Event? nextEvent) =>
isOwnMessage ||
room.isDirectChat ||
!isSameSenderWith(nextEvent) ||
Expand Down

0 comments on commit 014be33

Please sign in to comment.