Optimized account swipes invalidation

This commit is contained in:
M66B 2020-04-26 09:11:21 +02:00
parent bd7cae3cff
commit 3e96e50aff
2 changed files with 3 additions and 3 deletions

View File

@ -211,7 +211,7 @@ public abstract class DB extends RoomDatabase {
if (changed) {
Log.i("Invalidating folder view");
last = folders;
db.getInvalidationTracker().notifyObserversByTableNames("message");
db.getInvalidationTracker().notifyObserversByTableNames("account", "message");
}
}
});

View File

@ -105,8 +105,8 @@ public interface DaoAccount {
", account.swipe_left, l.type AS left_type, l.name AS left_name, l.color AS left_color" +
", account.swipe_right, r.type AS right_type, r.name AS right_name, r.color AS right_color" +
" FROM account" +
" LEFT JOIN folder l ON l.id = account.swipe_left" +
" LEFT JOIN folder r ON r.id = account.swipe_right" +
" LEFT JOIN folder_view l ON l.id = account.swipe_left" +
" LEFT JOIN folder_view r ON r.id = account.swipe_right" +
" WHERE :account IS NULL OR account.id = :account")
LiveData<List<TupleAccountSwipes>> liveAccountSwipes(Long account);