mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-14 12:52:03 +10:00
rollback-pr review
This commit is contained in:
@@ -45,16 +45,16 @@ class ChannelMessagePathScreen extends StatelessWidget {
|
||||
final hasHopDetails = primaryPath.isNotEmpty;
|
||||
|
||||
// Convert path byte length to hop count based on device width
|
||||
final width = primaryPath.isNotEmpty
|
||||
? PathHelper.detectPathHashWidth(primaryPath, fallback: connector.pathHashByteWidth)
|
||||
: connector.pathHashByteWidth.clamp(1, 4);
|
||||
final width = connector.pathHashByteWidth.clamp(1, 4);
|
||||
final observedHopCount = _hopCountFromBytes(primaryPath.length, width);
|
||||
final reportedHopCount = message.pathLength == null
|
||||
? null
|
||||
: (message.pathLength! < 0
|
||||
? message.pathLength
|
||||
: _hopCountFromBytes(message.pathLength!, width));
|
||||
final effectiveHopCount = observedHopCount > 0 ? observedHopCount : reportedHopCount;
|
||||
? message.pathLength
|
||||
: _hopCountFromBytes(message.pathLength!, width));
|
||||
final effectiveHopCount = observedHopCount > 0
|
||||
? observedHopCount
|
||||
: reportedHopCount;
|
||||
|
||||
final observedLabel = _formatObservedHops(
|
||||
observedHopCount,
|
||||
@@ -76,11 +76,11 @@ class ChannelMessagePathScreen extends StatelessWidget {
|
||||
title: context.l10n.contacts_repeaterPathTrace,
|
||||
path: primaryPath,
|
||||
flipPathAround: true,
|
||||
reversePathAround: !(!channelMessage && !message.isOutgoing),
|
||||
pathHashByteWidth: PathHelper.detectPathHashWidth(
|
||||
primaryPath,
|
||||
fallback: context.read<MeshCoreConnector>().pathHashByteWidth,
|
||||
),
|
||||
reversePathAround:
|
||||
!(!channelMessage && !message.isOutgoing),
|
||||
pathHashByteWidth: context
|
||||
.read<MeshCoreConnector>()
|
||||
.pathHashByteWidth,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -951,7 +951,8 @@ List<_PathHop> _buildPathHops(
|
||||
AppLocalizations l10n,
|
||||
) {
|
||||
if (pathBytes.isEmpty) return const [];
|
||||
final width = PathHelper.detectPathHashWidth(pathBytes, fallback: connector.pathHashByteWidth);
|
||||
|
||||
final width = connector.pathHashByteWidth.clamp(1, 4);
|
||||
final candidatesByHashBytes = <String, List<Contact>>{};
|
||||
final allContacts = connector.allContacts;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user