Optimistically update currentCustomVars in setCustomVar

Reflect the set value immediately so UI bound to currentCustomVars
(e.g. the GPS toggle in settings) updates on tap rather than waiting
for a later device-info refresh.
chore/offband-rebrand
zjs81 2 months ago
parent 4a72fbd1ad
commit 74840d3baf

@ -3295,6 +3295,13 @@ class MeshCoreConnector extends ChangeNotifier {
Future<void> setCustomVar(String value) async {
if (!isConnected) return;
await sendFrame(buildSetCustomVarFrame(value));
final sep = value.indexOf(':');
if (sep > 0) {
final key = value.substring(0, sep);
final val = value.substring(sep + 1);
(_currentCustomVars ??= <String, String>{})[key] = val;
notifyListeners();
}
if (value == 'gps:1') {
_startGpsLocationPolling();
} else if (value == 'gps:0') {

Loading…
Cancel
Save

Powered by TurnKey Linux.