fix last active on new message
This commit is contained in:
@@ -120,15 +120,17 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
stream: channel.lastMessageAtStream,
|
stream: channel.lastMessageAtStream,
|
||||||
initialData: channel.lastMessageAt,
|
initialData: channel.lastMessageAt,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
return (snapshot.data != null)
|
if (snapshot.data == null) {
|
||||||
? Text(
|
return SizedBox();
|
||||||
'Active ${Jiffy(snapshot.data.toLocal()).fromNow()}',
|
}
|
||||||
style: StreamChatTheme.of(context)
|
final jiffyDate = Jiffy(snapshot.data?.toLocal());
|
||||||
.channelTheme
|
return Text(
|
||||||
.channelHeaderTheme
|
'Active ${jiffyDate.isBefore(Jiffy()) ? jiffyDate.fromNow() : 'now'}',
|
||||||
.lastMessageAt,
|
style: StreamChatTheme.of(context)
|
||||||
)
|
.channelTheme
|
||||||
: SizedBox();
|
.channelHeaderTheme
|
||||||
|
.lastMessageAt,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user