From 88a4a93326f228b100877932083b921d1fdafc59 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 19 Sep 2023 14:54:10 -0700 Subject: [PATCH 1/2] Remove Activate Peer Engine from Mode Switch (Configure Connections Does this Automatically) --- lib/views/addeditprofileview.dart | 2 -- lib/views/contactsview.dart | 1 - 2 files changed, 3 deletions(-) diff --git a/lib/views/addeditprofileview.dart b/lib/views/addeditprofileview.dart index 094dcec2..54f8098a 100644 --- a/lib/views/addeditprofileview.dart +++ b/lib/views/addeditprofileview.dart @@ -236,7 +236,6 @@ class _AddEditProfileViewState extends State { onChanged: (bool value) { Provider.of(context, listen: false).enabled = value; if (value) { - Provider.of(context, listen: false).cwtch.ActivatePeerEngine(Provider.of(context, listen: false).onion); if (Provider.of(context, listen: false).appearOffline == false) { Provider.of(context, listen: false).cwtch.ConfigureConnections(Provider.of(context, listen: false).onion, true, true, true); } @@ -284,7 +283,6 @@ class _AddEditProfileViewState extends State { // if the profile is already enabled, then cycle the peer engine... if (value == true && Provider.of(context, listen: false).enabled) { Provider.of(context, listen: false).deactivatePeerEngine(context); - Provider.of(context, listen: false).cwtch.ActivatePeerEngine(onion); Provider.of(context, listen: false).cwtch.ConfigureConnections(onion, false, false, false); } } diff --git a/lib/views/contactsview.dart b/lib/views/contactsview.dart index 78dbc60e..e82328b0 100644 --- a/lib/views/contactsview.dart +++ b/lib/views/contactsview.dart @@ -182,7 +182,6 @@ class _ContactsViewState extends State { break; case ProfileStatusMenu.appearOffline: Provider.of(context, listen: false).deactivatePeerEngine(context); - Provider.of(context, listen: false).cwtch.ActivatePeerEngine(onion); Provider.of(context, listen: false).cwtch.ConfigureConnections(onion, false, false, false); break; case ProfileStatusMenu.editProfile: From e59b81f013dee6017ae456146dd4ca9daf99d8b6 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 19 Sep 2023 14:58:54 -0700 Subject: [PATCH 2/2] Activate Offline mode when switching --- lib/views/addeditprofileview.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/views/addeditprofileview.dart b/lib/views/addeditprofileview.dart index 54f8098a..c4c68ba9 100644 --- a/lib/views/addeditprofileview.dart +++ b/lib/views/addeditprofileview.dart @@ -238,6 +238,8 @@ class _AddEditProfileViewState extends State { if (value) { if (Provider.of(context, listen: false).appearOffline == false) { Provider.of(context, listen: false).cwtch.ConfigureConnections(Provider.of(context, listen: false).onion, true, true, true); + } else { + Provider.of(context, listen: false).cwtch.ConfigureConnections(Provider.of(context, listen: false).onion, false, false, false); } } else { Provider.of(context, listen: false).deactivatePeerEngine(context);