From 76cf2d5723a3fcdfe538992567d59e449a27e7dc Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 10 Nov 2022 15:51:39 +0100 Subject: [PATCH] Reselect swipe actions --- app/src/main/java/eu/faircode/email/Core.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index b3cbef8da9..345c38f43d 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -2663,6 +2663,28 @@ class Core { folder.setProperties(); folder.setSpecials(account); db.folder().updateFolder(folder); + + if (EntityFolder.TRASH.equals(folder.type) && + account.swipe_left != null && account.swipe_left > 0) { + EntityFolder swipe = db.folder().getFolder(account.swipe_left); + if (swipe == null) { + Log.e("Updated " + account.host + " swipe left"); + account.swipe_left = folder.id; + db.account().setAccountSwipes(account.id, + account.swipe_left, account.swipe_right); + } + } + + if (EntityFolder.ARCHIVE.equals(folder.type) && + account.swipe_right != null && account.swipe_right > 0) { + EntityFolder swipe = db.folder().getFolder(account.swipe_right); + if (swipe == null) { + Log.e("Updated " + account.host + " swipe right"); + account.swipe_right = folder.id; + db.account().setAccountSwipes(account.id, + account.swipe_left, account.swipe_right); + } + } } } }