From 3e96e50aff2f36d3fd09a06dc415a4f2b0959011 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 26 Apr 2020 09:11:21 +0200 Subject: [PATCH] Optimized account swipes invalidation --- app/src/main/java/eu/faircode/email/DB.java | 2 +- app/src/main/java/eu/faircode/email/DaoAccount.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/DB.java b/app/src/main/java/eu/faircode/email/DB.java index cbadd5cae1..85364325ad 100644 --- a/app/src/main/java/eu/faircode/email/DB.java +++ b/app/src/main/java/eu/faircode/email/DB.java @@ -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"); } } }); diff --git a/app/src/main/java/eu/faircode/email/DaoAccount.java b/app/src/main/java/eu/faircode/email/DaoAccount.java index 6cdca1a645..16f772b667 100644 --- a/app/src/main/java/eu/faircode/email/DaoAccount.java +++ b/app/src/main/java/eu/faircode/email/DaoAccount.java @@ -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> liveAccountSwipes(Long account);