From 46c435ab088cf5a674156daf89c9ae634c0b7c8a Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 21 Sep 2022 15:16:38 +0200 Subject: [PATCH] Restore previous logic to select the next message after deleting the current one --- .../src/main/java/com/fsck/k9/activity/MessageList.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt index fbb37fdfd..a78a33697 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt @@ -1198,10 +1198,16 @@ open class MessageList : } private fun showLogicalNextMessage(): Boolean { - return when (lastDirection) { + val couldMoveInLastDirection = when (lastDirection) { Direction.NEXT -> showNextMessage() Direction.PREVIOUS -> showPreviousMessage() } + + return if (couldMoveInLastDirection) { + true + } else { + showNextMessage() || showPreviousMessage() + } } override fun setProgress(enable: Boolean) {