Merge pull request 'Remove Activate Peer Engine from Mode Switch (Configure Connections Does this Automatically)' (#726) from stable-blockers into trunk
continuous-integration/drone/push Build was killed Details

Reviewed-on: #726
Reviewed-by: Dan Ballard <dan@openprivacy.ca>
This commit is contained in:
Sarah Jamie Lewis 2023-09-19 22:34:09 +00:00
commit 877a4e4fb3
2 changed files with 2 additions and 3 deletions

View File

@ -236,9 +236,10 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
onChanged: (bool value) {
Provider.of<ProfileInfoState>(context, listen: false).enabled = value;
if (value) {
Provider.of<FlwtchState>(context, listen: false).cwtch.ActivatePeerEngine(Provider.of<ProfileInfoState>(context, listen: false).onion);
if (Provider.of<ProfileInfoState>(context, listen: false).appearOffline == false) {
Provider.of<FlwtchState>(context, listen: false).cwtch.ConfigureConnections(Provider.of<ProfileInfoState>(context, listen: false).onion, true, true, true);
} else {
Provider.of<FlwtchState>(context, listen: false).cwtch.ConfigureConnections(Provider.of<ProfileInfoState>(context, listen: false).onion, false, false, false);
}
} else {
Provider.of<ProfileInfoState>(context, listen: false).deactivatePeerEngine(context);
@ -284,7 +285,6 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
// if the profile is already enabled, then cycle the peer engine...
if (value == true && Provider.of<ProfileInfoState>(context, listen: false).enabled) {
Provider.of<ProfileInfoState>(context, listen: false).deactivatePeerEngine(context);
Provider.of<FlwtchState>(context, listen: false).cwtch.ActivatePeerEngine(onion);
Provider.of<FlwtchState>(context, listen: false).cwtch.ConfigureConnections(onion, false, false, false);
}
}

View File

@ -182,7 +182,6 @@ class _ContactsViewState extends State<ContactsView> {
break;
case ProfileStatusMenu.appearOffline:
Provider.of<ProfileInfoState>(context, listen: false).deactivatePeerEngine(context);
Provider.of<FlwtchState>(context, listen: false).cwtch.ActivatePeerEngine(onion);
Provider.of<FlwtchState>(context, listen: false).cwtch.ConfigureConnections(onion, false, false, false);
break;
case ProfileStatusMenu.editProfile: