mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-06-27 04:37:28 +10:00
fix(settings): scope repeat preset memory to saved state
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user