fix startup issues

This commit is contained in:
Fabian Freund
2026-01-08 10:01:19 +01:00
parent 6f4654e0be
commit a64a5672dd
5 changed files with 129 additions and 51 deletions
@@ -47,7 +47,13 @@ class TorProxyScreen extends HookConsumerWidget {
if (next.requireValue.isRunning != previous?.value?.isRunning ||
next.requireValue.bootstrapProgress !=
previous?.value?.bootstrapProgress) {
torPendingRequest.value = null;
if (torPendingRequest.value == true) {
if (next.requireValue.bootstrapProgress > 0) {
torPendingRequest.value = null;
}
} else {
torPendingRequest.value = null;
}
}
}
});
@@ -58,9 +64,16 @@ class TorProxyScreen extends HookConsumerWidget {
),
);
final torIsBootstrapped = ref.watch(
torProxyServiceProvider.select(
(value) => value.value?.bootstrapProgress == 100,
),
);
final torIsBusy =
torPendingRequest.value != null ||
bootstrapProgress > 0 && bootstrapProgress < 100;
final torSettings = ref.watch(torSettingsWithDefaultsProvider);
useOnInitialization(() async {
@@ -446,7 +459,7 @@ class TorProxyScreen extends HookConsumerWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
if (torIsBusy)
if (torPendingRequest.value != false && torIsBusy)
Column(
mainAxisSize: MainAxisSize.min,
children: [
@@ -463,7 +476,9 @@ class TorProxyScreen extends HookConsumerWidget {
),
],
)
else if (torIsRunning)
else if (torPendingRequest.value != false &&
torIsRunning &&
torIsBootstrapped)
Padding(
padding: const EdgeInsets.only(top: 24.0),
child: Row(