Refactor repeater status screen and settings screen; add GPS toggle

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
zjs81
2026-05-08 13:27:05 -07:00
parent a92e57bb64
commit dc3325ec46
45 changed files with 13184 additions and 1400 deletions
+4 -12
View File
@@ -25,14 +25,6 @@ class RepeaterCommandService {
Function(int)? onAttempt,
int retries = maxRetries,
}) async {
final repeaterKey = repeater.publicKeyHex;
final hasPending = _pendingCommands.keys.any(
(id) => id.startsWith(repeaterKey),
);
if (hasPending) {
throw Exception('Another command is still awaiting a response.');
}
final attemptCount = retries < 1 ? 1 : retries;
final selection = await _connector.preparePathForContactSend(repeater);
@@ -62,14 +54,14 @@ class RepeaterCommandService {
int attempt,
) async {
final repeaterKey = repeater.publicKeyHex;
final commandId = '${repeaterKey}_${DateTime.now().millisecondsSinceEpoch}';
final prefix = _nextPrefixToken();
final commandId = '${repeaterKey}_$prefix';
final completer = Completer<String>();
_pendingCommands[commandId] = completer;
_commandPrefixes[commandId] = prefix;
_pendingByPrefix[prefix] = commandId;
try {
final prefix = _nextPrefixToken();
_commandPrefixes[commandId] = prefix;
_pendingByPrefix[prefix] = commandId;
final framedCommand = '$prefix$command';
final pathLengthValue = selection.useFlood ? -1 : selection.hopCount;
final timestampSeconds = DateTime.now().millisecondsSinceEpoch ~/ 1000;