Remove Activate Peer Engine from Mode Switch (Configure Connections Does this Automatically) #726

Merged
sarah merged 2 commits from stable-blockers into trunk 2023-09-19 22:34:10 +00:00
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: