mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-03-28 17:42:45 +01:00
fix(ui): fall back to echo SNR when message SNR is missing
meshcore library doesn't always provide SNR in CHANNEL_MSG_RECV events. Use the first echo path's SNR as fallback for inline display. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -775,8 +775,11 @@ function createMessageElement(msg) {
|
||||
}
|
||||
|
||||
let metaParts = [];
|
||||
if (msg.snr !== undefined && msg.snr !== null) {
|
||||
metaParts.push(`SNR: ${msg.snr.toFixed(1)} dB`);
|
||||
// Use message SNR, or fall back to first echo path SNR
|
||||
const displaySnr = (msg.snr !== undefined && msg.snr !== null) ? msg.snr
|
||||
: (msg.echo_snrs && msg.echo_snrs.length > 0) ? msg.echo_snrs[0] : null;
|
||||
if (displaySnr !== null) {
|
||||
metaParts.push(`SNR: ${displaySnr.toFixed(1)} dB`);
|
||||
}
|
||||
if (msg.path_len !== undefined && msg.path_len !== null) {
|
||||
metaParts.push(`Hops: ${msg.path_len}`);
|
||||
|
||||
Reference in New Issue
Block a user