fix: Update read receipt display

This commit is contained in:
Christian Pauly 2021-02-13 10:34:02 +01:00
parent bd24387212
commit de6e49515e

View File

@ -60,8 +60,6 @@ class _ChatState extends State<Chat> {
MatrixState matrix;
String seenByText = '';
final AutoScrollController _scrollController = AutoScrollController();
FocusNode inputFocus = FocusNode();
@ -150,8 +148,6 @@ class _ChatState extends State<Chat> {
() {
filteredEvents =
timeline.getFilteredEvents(collapseRoomCreate: _collapseRoomCreate);
seenByText =
room.getLocalizedSeenByText(context, timeline, filteredEvents);
},
);
}
@ -751,7 +747,15 @@ class _ChatState extends State<Chat> {
)
: Container()
: i == 0
? AnimatedContainer(
? StreamBuilder(
stream: room.onUpdate.stream,
builder: (_, __) {
final seenByText =
room.getLocalizedSeenByText(
context,
timeline,
filteredEvents);
return AnimatedContainer(
height: seenByText.isEmpty ? 0 : 24,
duration: seenByText.isEmpty
? Duration(milliseconds: 0)
@ -776,8 +780,8 @@ class _ChatState extends State<Chat> {
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color:
Theme.of(context).accentColor,
color: Theme.of(context)
.accentColor,
),
),
),
@ -786,6 +790,8 @@ class _ChatState extends State<Chat> {
right: 8,
bottom: 8,
),
);
},
)
: AutoScrollTag(
key: ValueKey(