mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-04-20 22:13:48 +00:00
Handle loading state and error parsing in PathTraceMapScreen; update SNR indicator dialog content layout
This commit is contained in:
parent
75a7f437f6
commit
940a1be203
2 changed files with 16 additions and 1 deletions
|
|
@ -166,6 +166,15 @@ class _PathTraceMapScreenState extends State<PathTraceMapScreen> {
|
|||
});
|
||||
}
|
||||
|
||||
if (code == respCodeErr) {
|
||||
_timeoutTimer?.cancel();
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
_failed2Loaded = true;
|
||||
});
|
||||
}
|
||||
|
||||
// Check if it's a binary response
|
||||
if (frame.length > 8 &&
|
||||
code == pushCodeTraceData &&
|
||||
|
|
@ -178,6 +187,12 @@ class _PathTraceMapScreenState extends State<PathTraceMapScreen> {
|
|||
}
|
||||
}
|
||||
} catch (e) {
|
||||
_timeoutTimer?.cancel();
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
_failed2Loaded = true;
|
||||
});
|
||||
// Handle any parsing errors gracefully
|
||||
appLogger.error('Error parsing frame: $e', tag: 'PathTraceMapScreen');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class _SNRIndicatorState extends State<SNRIndicator> {
|
|||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(l10n.snrIndicator_nearByRepeaters),
|
||||
content: Expanded(
|
||||
content: SizedBox(
|
||||
child: Scrollbar(
|
||||
child: ListView.separated(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue