WT1.1.18+8 repeats MAX

This commit is contained in:
bossanyit
2021-06-07 17:28:25 +02:00
parent f5ef0ed9ce
commit a8728edae2
10 changed files with 73 additions and 44 deletions
+9 -1
View File
@@ -91,7 +91,15 @@ class PackageApi {
final Iterable json = jsonDecode(headRecord[1]);
final List<TrainingPlan>? plans = json.map((plan) => TrainingPlan.fromJson(plan)).toList();
Cache().setTrainingPlans(plans);
List<TrainingPlan> activePlans = [];
if (plans != null) {
plans.forEach((element) {
if (element.active) {
activePlans.add(element);
}
});
}
Cache().setTrainingPlans(activePlans);
} else if (headRecord[0] == "SplitTests") {
final Iterable json = jsonDecode(headRecord[1]);
final List<SplitTest>? tests = json.map((test) => SplitTest.fromJson(test)).toList();