Skip to content

Commit

Permalink
invalidate cache when a target entry was deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
mathisdt committed Apr 6, 2023
1 parent 10044c7 commit 395ec8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ public boolean onOptionsItemSelected(MenuItem item) {
case DELETE_TARGET:
Logger.debug("Deleting target {}", editedTarget.toString());
dao.deleteTarget(editedTarget);

// we have to call this manually when using the DAO directly
timerManager.invalidateCacheFrom(targetDay);
Basics.get(this).safeCheckPersistentNotification();

finish();
case android.R.id.home:
finish();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ public synchronized Target updateTarget(Target target) {
public boolean deleteTarget(Target target) {
open();
final boolean result = db.delete(TARGET, TARGET_ID + "=" + target.getId(), null) > 0;
//dataChanged(); // TODO
dataChanged();
return result;
}

Expand Down

0 comments on commit 395ec8e

Please sign in to comment.