initial
This commit is contained in:
@@ -31,11 +31,11 @@ class StartProxyController extends _$StartProxyController {
|
||||
// ignore: document_ignores is used for dialog
|
||||
// ignore: avoid_build_context_in_providers
|
||||
Future<void> maybeStartProxy(BuildContext context) async {
|
||||
final torProxyRunning = await ref
|
||||
final currentStatus = await ref
|
||||
.read(torProxyServiceProvider.notifier)
|
||||
.requestSync();
|
||||
|
||||
if (torProxyRunning == null) {
|
||||
if (!currentStatus.isRunning) {
|
||||
if (context.mounted) {
|
||||
final result = await showDialog<bool>(
|
||||
context: context,
|
||||
@@ -47,7 +47,7 @@ class StartProxyController extends _$StartProxyController {
|
||||
if (result == true) {
|
||||
final connection = ref
|
||||
.read(torProxyServiceProvider.notifier)
|
||||
.startOrReconfigure();
|
||||
.startOrReconfigure(reconfigureIfRunning: false);
|
||||
|
||||
ref
|
||||
.read(overlayControllerProvider.notifier)
|
||||
@@ -59,9 +59,6 @@ class StartProxyController extends _$StartProxyController {
|
||||
await connection;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//Reconfigure
|
||||
await ref.read(torProxyServiceProvider.notifier).startOrReconfigure();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ final class StartProxyControllerProvider
|
||||
}
|
||||
|
||||
String _$startProxyControllerHash() =>
|
||||
r'86a015a0c257ea18ad23aa28bdd43d289b6bfc64';
|
||||
r'13c6ad9611a2f9525689d370a0511274aa9c0f03';
|
||||
|
||||
abstract class _$StartProxyController extends $Notifier<void> {
|
||||
void build();
|
||||
|
||||
Reference in New Issue
Block a user