fix(settings): scope repeat preset memory to saved state

This commit is contained in:
just-stuff-tm
2026-03-11 11:19:53 -04:00
parent c9145c99d3
commit 36697c6e61
+13 -15
View File
@@ -1155,9 +1155,7 @@ class _RadioSettingsDialogState extends State<_RadioSettingsDialog> {
_lastNonRepeatSnapshot!, _lastNonRepeatSnapshot!,
); );
} else { } else {
_lastNonRepeatSnapshot = _lastNonRepeatSnapshot = _nonRepeatSnapshotForCurrentSelection();
_sessionRememberedNonRepeatSnapshot() ??
_nonRepeatSnapshotForCurrentSelection();
} }
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted) return; if (!mounted) return;
@@ -1461,6 +1459,18 @@ class _RadioSettingsDialogState extends State<_RadioSettingsDialog> {
} }
try { try {
_logRadioSettingsState('Saving radio settings');
await widget.connector.sendFrame(
buildSetRadioParamsFrame(
freqHz,
bwHz,
sf,
cr,
clientRepeat: knownRepeat ? _clientRepeat : null,
),
);
await widget.connector.sendFrame(buildSetRadioTxPowerFrame(txPower));
await widget.connector.refreshDeviceInfo();
final rememberedSnapshot = _clientRepeat final rememberedSnapshot = _clientRepeat
? _lastNonRepeatSnapshot ? _lastNonRepeatSnapshot
: _currentSnapshot(); : _currentSnapshot();
@@ -1478,18 +1488,6 @@ class _RadioSettingsDialogState extends State<_RadioSettingsDialog> {
), ),
); );
} }
_logRadioSettingsState('Saving radio settings');
await widget.connector.sendFrame(
buildSetRadioParamsFrame(
freqHz,
bwHz,
sf,
cr,
clientRepeat: knownRepeat ? _clientRepeat : null,
),
);
await widget.connector.sendFrame(buildSetRadioTxPowerFrame(txPower));
await widget.connector.refreshDeviceInfo();
if (!mounted) return; if (!mounted) return;
Navigator.pop(context); Navigator.pop(context);