mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-03 09:19:22 +00:00
Tor kill switch getter name refactor and bugfix
This commit is contained in:
parent
af88673df1
commit
4b518243c6
4 changed files with 17 additions and 12 deletions
|
@ -190,7 +190,7 @@ class ElectrumX {
|
|||
// But Tor isn't enabled...
|
||||
if (!_torService.enabled) {
|
||||
// And the killswitch isn't set...
|
||||
if (!_prefs.torKillswitch) {
|
||||
if (!_prefs.torKillSwitch) {
|
||||
// Then we'll just proceed and connect to ElectrumX through clearnet at the bottom of this function.
|
||||
Logging.instance.log(
|
||||
"Tor preference set but Tor is not enabled, killswitch not set, connecting to ElectrumX through clearnet",
|
||||
|
|
|
@ -170,12 +170,12 @@ class _TorSettingsViewState extends ConsumerState<TorSettingsView> {
|
|||
child: DraggableSwitchButton(
|
||||
isOn: ref.watch(
|
||||
prefsChangeNotifierProvider
|
||||
.select((value) => value.torKillswitch),
|
||||
.select((value) => value.torKillSwitch),
|
||||
),
|
||||
onValueChanged: (newValue) {
|
||||
ref
|
||||
.read(prefsChangeNotifierProvider)
|
||||
.torKillswitch = newValue;
|
||||
.torKillSwitch = newValue;
|
||||
},
|
||||
),
|
||||
),
|
||||
|
|
|
@ -383,12 +383,12 @@ class _TorSettingsState extends ConsumerState<TorSettings> {
|
|||
child: DraggableSwitchButton(
|
||||
isOn: ref.watch(
|
||||
prefsChangeNotifierProvider
|
||||
.select((value) => value.torKillswitch),
|
||||
.select((value) => value.torKillSwitch),
|
||||
),
|
||||
onValueChanged: (newValue) {
|
||||
ref
|
||||
.read(prefsChangeNotifierProvider)
|
||||
.torKillswitch = newValue;
|
||||
.torKillSwitch = newValue;
|
||||
},
|
||||
),
|
||||
),
|
||||
|
|
|
@ -399,14 +399,17 @@ class Prefs extends ChangeNotifier {
|
|||
|
||||
// tor
|
||||
|
||||
bool _torKillswitch = false;
|
||||
bool _torKillswitch = true;
|
||||
|
||||
bool get torKillswitch => _torKillswitch;
|
||||
bool get torKillSwitch => _torKillswitch;
|
||||
|
||||
set torKillswitch(bool torKillswitch) {
|
||||
if (_torKillswitch != showTestNetCoins) {
|
||||
set torKillSwitch(bool torKillswitch) {
|
||||
if (_torKillswitch != torKillswitch) {
|
||||
DB.instance.put<dynamic>(
|
||||
boxName: DB.boxNamePrefs, key: "torKillswitch", value: torKillswitch);
|
||||
boxName: DB.boxNamePrefs,
|
||||
key: "torKillswitch",
|
||||
value: torKillswitch,
|
||||
);
|
||||
_torKillswitch = torKillswitch;
|
||||
notifyListeners();
|
||||
}
|
||||
|
@ -414,8 +417,10 @@ class Prefs extends ChangeNotifier {
|
|||
|
||||
Future<bool> _getTorKillswitch() async {
|
||||
return await DB.instance.get<dynamic>(
|
||||
boxName: DB.boxNamePrefs, key: "torKillswitch") as bool? ??
|
||||
false;
|
||||
boxName: DB.boxNamePrefs,
|
||||
key: "torKillswitch",
|
||||
) as bool? ??
|
||||
true;
|
||||
}
|
||||
|
||||
// show testnet coins
|
||||
|
|
Loading…
Reference in a new issue