diff --git a/LIBCWTCH-GO.version b/LIBCWTCH-GO.version index e9884e56..27c2c985 100644 --- a/LIBCWTCH-GO.version +++ b/LIBCWTCH-GO.version @@ -1 +1 @@ -2023-09-19-13-05-v0.0.7 \ No newline at end of file +2023-09-19-17-02-v0.0.8 \ No newline at end of file diff --git a/lib/models/profile.dart b/lib/models/profile.dart index 081b5aaa..cbdcbcaf 100644 --- a/lib/models/profile.dart +++ b/lib/models/profile.dart @@ -486,6 +486,8 @@ class ProfileInfoState extends ChangeNotifier { Provider.of(context, listen: false).cwtch.DeactivatePeerEngine(onion); this.contactList.contacts.forEach((element) { element.status = "Disconnected"; + // reset retry time to allow for instant reconnection... + element.lastRetryTime = element.loaded; }); this.serverList.servers.forEach((element) { element.status = "Disconnected"; diff --git a/lib/widgets/messagelist.dart b/lib/widgets/messagelist.dart index 0b3bd4d7..63635f3b 100644 --- a/lib/widgets/messagelist.dart +++ b/lib/widgets/messagelist.dart @@ -51,9 +51,9 @@ class _MessageListState extends State { // 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(context, listen: false).lastRetryTime).abs() > Duration(seconds: 60) || - Provider.of(context, listen: false).appearOffline && - (Provider.of(context, listen: false).lastRetryTime == Provider.of(context, listen: false).loaded); + bool canReconnect = DateTime.now().difference(Provider.of(context, listen: false).lastRetryTime).abs() > Duration(seconds: 30) || + (Provider.of(context, listen: false).appearOffline && + (Provider.of(context, listen: false).lastRetryTime == Provider.of(context, listen: false).loaded)); var reconnectButton = Padding( padding: EdgeInsets.all(2),