From 7f6f63bcf44d1ecc84f303f17c4c0a25bb3b9b81 Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Sun, 1 Jan 2023 14:22:30 +0100 Subject: [PATCH] comboctl-main: Always move past skipped screens in navigateToRTScreen() Without this, navigation gets stuck if an unrecognized screen is encountered. Signed-off-by: Carlos Rafael Giani --- .../kotlin/info/nightscout/comboctl/main/RTNavigation.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pump/combov2/comboctl/src/commonMain/kotlin/info/nightscout/comboctl/main/RTNavigation.kt b/pump/combov2/comboctl/src/commonMain/kotlin/info/nightscout/comboctl/main/RTNavigation.kt index 1789e916d1..4e1606dda1 100644 --- a/pump/combov2/comboctl/src/commonMain/kotlin/info/nightscout/comboctl/main/RTNavigation.kt +++ b/pump/combov2/comboctl/src/commonMain/kotlin/info/nightscout/comboctl/main/RTNavigation.kt @@ -1004,7 +1004,9 @@ suspend fun navigateToRTScreen( // when remaining TBR duration is shown on the main screen and the // duration happens to change during this loop. If this occurs, // skip the redundant screen. - if ((previousScreenType != null) && (previousScreenType == parsedScreen::class)) { + if ((parsedScreen::class != ParsedScreen.UnrecognizedScreen::class) && + (previousScreenType != null) && + (previousScreenType == parsedScreen::class)) { logger(LogLevel.DEBUG) { "Got a screen of the same type ${parsedScreen::class}; skipping" } continue }