|
|
|
@ -51,9 +51,9 @@ class _MessageListState extends State<MessageList> {
|
|
|
|
|
// OR if users have never clicked the button AND they appear offline, then they can click the button
|
|
|
|
|
// NOTE: all these listeners are false...this is not ideal, but if they were true we would end up rebuilding the message view every tick (which would kill performance)
|
|
|
|
|
// any significant changes in state e.g. peer offline or button clicks will trigger a rebuild anyway
|
|
|
|
|
bool canReconnect = DateTime.now().difference(Provider.of<ContactInfoState>(context, listen: false).lastRetryTime).abs() > Duration(seconds: 60) ||
|
|
|
|
|
Provider.of<ProfileInfoState>(context, listen: false).appearOffline &&
|
|
|
|
|
(Provider.of<ContactInfoState>(context, listen: false).lastRetryTime == Provider.of<ContactInfoState>(context, listen: false).loaded);
|
|
|
|
|
bool canReconnect = DateTime.now().difference(Provider.of<ContactInfoState>(context, listen: false).lastRetryTime).abs() > Duration(seconds: 30) ||
|
|
|
|
|
(Provider.of<ProfileInfoState>(context, listen: false).appearOffline &&
|
|
|
|
|
(Provider.of<ContactInfoState>(context, listen: false).lastRetryTime == Provider.of<ContactInfoState>(context, listen: false).loaded));
|
|
|
|
|
|
|
|
|
|
var reconnectButton = Padding(
|
|
|
|
|
padding: EdgeInsets.all(2),
|
|
|
|
|