Skip to content

Commit 4caa23e

Browse files
committed
feat(tor): when tor is enabled, also enable the killswitch
1 parent 2aedb15 commit 4caa23e

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

lib/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,10 @@ Future<void> connectTor(WidgetRef ref, BuildContext context) async {
603603

604604
// Toggle the useTor preference on success.
605605
ref.read(prefsChangeNotifierProvider).useTor = true;
606+
607+
// Toggle the torKillswitch preference on success.
608+
ref.read(prefsChangeNotifierProvider).torKillSwitch = true;
609+
// TODO [prio=pup]: Only toggle this the first time the user connects to Tor.
606610
} catch (e, s) {
607611
Logging.instance.e("Error starting tor: ", error: e, stackTrace: s);
608612
// TODO: show dialog with error message

lib/pages_desktop_specific/settings/settings_menu/tor_settings/tor_settings.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ class _TorSettingsState extends ConsumerState<TorSettings> {
7070

7171
// Toggle the useTor preference on success.
7272
ref.read(prefsChangeNotifierProvider).useTor = true;
73+
74+
// Toggle the torKillswitch preference on success.
75+
ref.read(prefsChangeNotifierProvider).torKillSwitch = true;
76+
// TODO [prio=pup]: Only toggle this the first time the user connects to Tor.
7377
} catch (e, s) {
7478
Logging.instance.e("Error starting tor: ", error: e, stackTrace: s);
7579
// TODO: show dialog with error message

0 commit comments

Comments
 (0)