Only show appear offline if not in test mode (bug in test framework cannot scroll past)
continuous-integration/drone/pr Build is pending
Details
continuous-integration/drone/pr Build is pending
Details
This commit is contained in:
parent
3856591d2f
commit
18bbfdea54
|
@ -268,28 +268,31 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
|
|||
secondary: Icon(CwtchIcons.favorite_24dp, color: Provider.of<Settings>(context).current().mainTextColor),
|
||||
),
|
||||
|
||||
// Auto start
|
||||
SwitchListTile(
|
||||
title: Text(AppLocalizations.of(context)!.profileAppearOffline, style: TextStyle(color: Provider.of<Settings>(context).current().mainTextColor)),
|
||||
subtitle: Text(AppLocalizations.of(context)!.profileAppearOfflineDescription),
|
||||
value: Provider.of<ProfileInfoState>(context).appearOffline,
|
||||
onChanged: (bool value) {
|
||||
Provider.of<ProfileInfoState>(context, listen: false).appearOffline = value;
|
||||
var onion = Provider.of<ProfileInfoState>(context, listen: false).onion;
|
||||
if (!onion.isEmpty) {
|
||||
Provider.of<FlwtchState>(context, listen: false).cwtch.SetProfileAttribute(onion, "profile.appear-offline", value ? "true" : "false");
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
},
|
||||
activeTrackColor: Provider.of<Settings>(context).theme.defaultButtonColor,
|
||||
inactiveTrackColor: Provider.of<Settings>(context).theme.defaultButtonDisabledColor,
|
||||
secondary: Icon(CwtchIcons.favorite_24dp, color: Provider.of<Settings>(context).current().mainTextColor),
|
||||
),
|
||||
// Appear Offline
|
||||
Visibility(
|
||||
// FIXME don't show the disable switch in test mode...this is a bug relating to scrolling things into view
|
||||
visible: Provider.of<ProfileInfoState>(context).onion.isNotEmpty && (EnvironmentConfig.TEST_MODE == false),
|
||||
child: SwitchListTile(
|
||||
title: Text(AppLocalizations.of(context)!.profileAppearOffline, style: TextStyle(color: Provider.of<Settings>(context).current().mainTextColor)),
|
||||
subtitle: Text(AppLocalizations.of(context)!.profileAppearOfflineDescription),
|
||||
value: Provider.of<ProfileInfoState>(context).appearOffline,
|
||||
onChanged: (bool value) {
|
||||
Provider.of<ProfileInfoState>(context, listen: false).appearOffline = value;
|
||||
var onion = Provider.of<ProfileInfoState>(context, listen: false).onion;
|
||||
if (!onion.isEmpty) {
|
||||
Provider.of<FlwtchState>(context, listen: false).cwtch.SetProfileAttribute(onion, "profile.appear-offline", value ? "true" : "false");
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
},
|
||||
activeTrackColor: Provider.of<Settings>(context).theme.defaultButtonColor,
|
||||
inactiveTrackColor: Provider.of<Settings>(context).theme.defaultButtonDisabledColor,
|
||||
secondary: Icon(CwtchIcons.favorite_24dp, color: Provider.of<Settings>(context).current().mainTextColor),
|
||||
)),
|
||||
|
||||
Visibility(
|
||||
visible: Provider.of<ProfileInfoState>(context).onion.isEmpty,
|
||||
|
|
Loading…
Reference in New Issue