Token management, Factory reset, UX/UI Improvements
This commit is contained in:
@@ -43,6 +43,8 @@ class _ESPTouchDialog extends State<ESPTouchDialog> {
|
||||
|
||||
final touchStream = task.execute();
|
||||
final sub = touchStream.listen((data) async {
|
||||
var conf = AppConfig();
|
||||
|
||||
final dev = Device(
|
||||
name: widget.name,
|
||||
routerSsid: widget.ssid,
|
||||
@@ -50,11 +52,14 @@ class _ESPTouchDialog extends State<ESPTouchDialog> {
|
||||
networkPassword: widget.password,
|
||||
);
|
||||
|
||||
if (widget.entryIndex != null) {
|
||||
final oldDev = conf.devices[widget.entryIndex!];
|
||||
dev.token = oldDev.token;
|
||||
}
|
||||
|
||||
dev.ip = data.ip;
|
||||
dev.bssid = data.bssid;
|
||||
|
||||
var conf = AppConfig();
|
||||
|
||||
if (widget.addNewEntry) {
|
||||
conf.devices.add(dev);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user