mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 08:20:36 +00:00
fix: Correct neighbor times ref:
This commit is contained in:
@@ -5,22 +5,22 @@
|
||||
|
||||
|
||||
|
||||
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000616">
|
||||
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000201">
|
||||
|
||||
</testcase>
|
||||
|
||||
|
||||
<testcase classname="fastlane.lanes" name="1: increment_build_number" time="0.370543">
|
||||
<testcase classname="fastlane.lanes" name="1: increment_build_number" time="0.700922">
|
||||
|
||||
</testcase>
|
||||
|
||||
|
||||
<testcase classname="fastlane.lanes" name="2: build_app" time="105.689527">
|
||||
<testcase classname="fastlane.lanes" name="2: build_app" time="102.603385">
|
||||
|
||||
</testcase>
|
||||
|
||||
|
||||
<testcase classname="fastlane.lanes" name="3: upload_to_app_store" time="237.850068">
|
||||
<testcase classname="fastlane.lanes" name="3: upload_to_app_store" time="2538.71069">
|
||||
|
||||
</testcase>
|
||||
|
||||
|
||||
@@ -1839,16 +1839,24 @@ class _NeighboursSheetState extends State<_NeighboursSheet> {
|
||||
final parts = trimmed.split(':');
|
||||
if (parts.length >= 3) {
|
||||
final keyHex = parts[0];
|
||||
final timestampOrMs = int.tryParse(parts[1]);
|
||||
final timestampOrSeconds = int.tryParse(parts[1]);
|
||||
final snrRaw = int.tryParse(parts[2]);
|
||||
final isMs = timestampOrMs != null && timestampOrMs < 1e9;
|
||||
final isDurationSeconds =
|
||||
timestampOrSeconds != null && timestampOrSeconds < 1000000000;
|
||||
parsed.add(
|
||||
_Neighbour(
|
||||
publicKeyHex: keyHex,
|
||||
lastSeenAt: !isMs && timestampOrMs != null
|
||||
? DateTime.fromMillisecondsSinceEpoch(timestampOrMs * 1000)
|
||||
lastSeenAt: !isDurationSeconds && timestampOrSeconds != null
|
||||
? timestampOrSeconds >= 1000000000000
|
||||
? DateTime.fromMillisecondsSinceEpoch(
|
||||
timestampOrSeconds,
|
||||
)
|
||||
: DateTime.fromMillisecondsSinceEpoch(
|
||||
timestampOrSeconds * 1000,
|
||||
)
|
||||
: null,
|
||||
lastSeenMs: isMs ? timestampOrMs : null,
|
||||
lastSeenSeconds:
|
||||
isDurationSeconds ? timestampOrSeconds : null,
|
||||
snrDb: snrRaw != null ? snrRaw / 4.0 : null,
|
||||
),
|
||||
);
|
||||
@@ -1896,12 +1904,12 @@ class _NeighboursSheetState extends State<_NeighboursSheet> {
|
||||
.difference(neighbour.lastSeenAt!)
|
||||
.toLocalizedTimeAgoWithSeconds(context);
|
||||
}
|
||||
if (neighbour.lastSeenMs != null) {
|
||||
if (neighbour.lastSeenMs! < 1000) {
|
||||
if (neighbour.lastSeenSeconds != null) {
|
||||
if (neighbour.lastSeenSeconds! < 1) {
|
||||
return AppLocalizations.of(context)!.justNow;
|
||||
}
|
||||
return Duration(
|
||||
milliseconds: neighbour.lastSeenMs!,
|
||||
seconds: neighbour.lastSeenSeconds!,
|
||||
).toLocalizedTimeAgoWithSeconds(context);
|
||||
}
|
||||
return AppLocalizations.of(context)!.justNow;
|
||||
@@ -2295,13 +2303,13 @@ class _NeighboursSheetState extends State<_NeighboursSheet> {
|
||||
class _Neighbour {
|
||||
final String publicKeyHex;
|
||||
final DateTime? lastSeenAt;
|
||||
final int? lastSeenMs;
|
||||
final int? lastSeenSeconds;
|
||||
final double? snrDb;
|
||||
|
||||
const _Neighbour({
|
||||
required this.publicKeyHex,
|
||||
this.lastSeenAt,
|
||||
this.lastSeenMs,
|
||||
this.lastSeenSeconds,
|
||||
this.snrDb,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user