WT1.1.0+24 CustomerExerciseDevice fix, Badges fix
This commit is contained in:
@@ -27,6 +27,8 @@ class CustomerExerciseDeviceRepository {
|
||||
found = element;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
_devices = List();
|
||||
}
|
||||
if (found == null) {
|
||||
int customerId;
|
||||
@@ -36,8 +38,8 @@ class CustomerExerciseDeviceRepository {
|
||||
CustomerExerciseDevice newDevice =
|
||||
CustomerExerciseDevice(customerId: customerId, exerciseDeviceId: device.exerciseDeviceId, favourite: false);
|
||||
newDevice.change = ModelChange.add;
|
||||
await CustomerExerciseDeviceApi().addDevice(newDevice);
|
||||
this._devices.add(newDevice);
|
||||
CustomerExerciseDevice saved = await CustomerExerciseDeviceApi().addDevice(newDevice);
|
||||
this._devices.add(saved);
|
||||
Cache().setCustomerDevices(_devices);
|
||||
}
|
||||
}
|
||||
@@ -55,9 +57,9 @@ class CustomerExerciseDeviceRepository {
|
||||
}
|
||||
if (found != null) {
|
||||
this._devices.remove(found);
|
||||
if (found.change != ModelChange.add) {
|
||||
await CustomerExerciseDeviceApi().removeDevice(found.customerExerciseDeviceId);
|
||||
}
|
||||
//if (found.change != ModelChange.add) {
|
||||
await CustomerExerciseDeviceApi().removeDevice(found.customerExerciseDeviceId);
|
||||
//}
|
||||
Cache().setCustomerDevices(_devices);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user