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