mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 16:30:28 +00:00
fix: Hide Cleared Paths, Unify Sensor Actions #0
This commit is contained in:
@@ -721,9 +721,7 @@ class _ContactRouteDialogState extends State<ContactRouteDialog> {
|
||||
alignment: Alignment.centerRight,
|
||||
child: TextButton(
|
||||
onPressed: () async {
|
||||
await _pathHistoryService.clearHistoryFor(
|
||||
widget.contact.publicKeyHex,
|
||||
);
|
||||
await _pathHistoryService.clearHistoryForContact(widget.contact);
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_pathHistory = _pathHistoryService.historyFor(
|
||||
|
||||
@@ -13,6 +13,7 @@ import '../../providers/messages_provider.dart';
|
||||
import '../../providers/sensors_provider.dart';
|
||||
import '../../services/location_tracking_service.dart';
|
||||
import '../../services/message_destination_preferences.dart';
|
||||
import '../../services/path_history_service.dart';
|
||||
import 'contact_route_dialog.dart';
|
||||
import 'contact_trace_sheet.dart';
|
||||
import 'room_login_sheet.dart';
|
||||
@@ -786,6 +787,7 @@ class ContactTile extends StatelessWidget {
|
||||
) async {
|
||||
final contactsProvider = context.read<ContactsProvider>();
|
||||
final connectionProvider = context.read<ConnectionProvider>();
|
||||
final pathHistoryService = PathHistoryService();
|
||||
final availableContacts = contactsProvider.contacts
|
||||
.where((candidate) => candidate.publicKeyHex != contact.publicKeyHex)
|
||||
.toList();
|
||||
@@ -846,6 +848,12 @@ class ContactTile extends StatelessWidget {
|
||||
signedEncodedPathLen: parsedRoute.signedEncodedPathLen,
|
||||
paddedPathBytes: parsedRoute.paddedPathBytes,
|
||||
);
|
||||
await pathHistoryService.clearHistoryForContact(
|
||||
contact.copyWith(
|
||||
outPathLen: parsedRoute.signedEncodedPathLen,
|
||||
outPath: Uint8List.fromList(parsedRoute.paddedPathBytes),
|
||||
),
|
||||
);
|
||||
if (context.mounted) {
|
||||
final routeLabel = parsedRoute.hopCount == 0
|
||||
? AppLocalizations.of(context)!.direct
|
||||
|
||||
Reference in New Issue
Block a user