Skip to content

Commit

Permalink
Fixed carbs of food eaten when updating entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Faltenreich committed Jan 8, 2022
1 parent 5955196 commit d888f1e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,12 @@ private void submit() {
EntryTagDao.getInstance().deleteAll(entry);
EntryTagDao.getInstance().bulkCreateOrUpdate(entryTags);

// FIXME: Displays 0 carbs when editing food
List<FoodEaten> foodEatenList = getFoodEaten();

// Force update in order to synchronize the measurement cache
entry = EntryDao.getInstance().getById(entry.getId());
entry.setMeasurementCache(EntryDao.getInstance().getMeasurements(entry));

if (isNewEntry) {
Toast.makeText(getContext(), getString(R.string.entry_added), Toast.LENGTH_LONG).show();
Events.post(new EntryAddedEvent(entry, entryTags, foodEatenList));
Expand Down

0 comments on commit d888f1e

Please sign in to comment.