diff --git a/crypto_plugins/tor b/crypto_plugins/tor index 0979ac52a..84ad84e07 160000 --- a/crypto_plugins/tor +++ b/crypto_plugins/tor @@ -1 +1 @@ -Subproject commit 0979ac52a783ff7b87669434b39385f27a27f952 +Subproject commit 84ad84e07dee5b64828ad5ce380491b3aa798cc3 diff --git a/lib/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart b/lib/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart index 06944b579..b0783c9d7 100644 --- a/lib/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart +++ b/lib/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart @@ -364,6 +364,13 @@ class _TorSettingsViewState extends ConsumerState { ); } + /// Connect to the Tor network. + /// + /// This method is called when the user taps the "Connect" button. + /// + /// Throws an exception if the Tor service fails to start. + /// + /// Returns a Future that completes when the Tor service has started. Future connect() async { // Init the Tor service if it hasn't already been. ref.read(pTorService).init(); @@ -381,6 +388,7 @@ class _TorSettingsViewState extends ConsumerState { ); } + // Update the UI. setState(() { _networkStatus = TorConnectionStatus.connecting; }); @@ -388,6 +396,13 @@ class _TorSettingsViewState extends ConsumerState { return; } + /// Disconnect from the Tor network. + /// + /// This method is called when the user taps the "Disconnect" button. + /// + /// Throws an exception if the Tor service fails to stop. + /// + /// Returns a Future that completes when the Tor service has stopped. Future disconnect() async { // Stop the Tor service. try { diff --git a/lib/services/tor_service.dart b/lib/services/tor_service.dart index 90930d472..ead6ab5fa 100644 --- a/lib/services/tor_service.dart +++ b/lib/services/tor_service.dart @@ -121,7 +121,7 @@ class TorService { // Stop the Tor service. try { - await _tor!.disable(); + _tor!.disable(); // no exception or error so we can (probably?) assume tor // has started successfully _enabled = false;