Reset the plan's logs when loading new ones

This commit is contained in:
Roland Geider
2021-08-16 18:05:12 +02:00
parent 7a06789901
commit c00a755f0d

View File

@@ -346,6 +346,7 @@ class NutritionPlansProvider extends WgerBaseProvider with ChangeNotifier {
makeUrl(_nutritionDiaryPath, query: {'plan': plan.id.toString(), 'limit': '1000'}),
);
plan.logs = [];
for (var logData in data['results']) {
var log = Log.fromJson(logData);
final ingredient = await fetchIngredient(log.ingredientId);