From b79a20dfce244cd50269573b192025053b23815b Mon Sep 17 00:00:00 2001 From: zachseidner1 Date: Sun, 27 Oct 2024 14:18:54 -0400 Subject: [PATCH 1/2] Coerce at least 0 --- .../android/eatery/ui/screens/EateryDetailScreen.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/cornellappdev/android/eatery/ui/screens/EateryDetailScreen.kt b/app/src/main/java/com/cornellappdev/android/eatery/ui/screens/EateryDetailScreen.kt index d154d13..1986e20 100644 --- a/app/src/main/java/com/cornellappdev/android/eatery/ui/screens/EateryDetailScreen.kt +++ b/app/src/main/java/com/cornellappdev/android/eatery/ui/screens/EateryDetailScreen.kt @@ -228,7 +228,8 @@ fun EateryDetailScreen( val mealTypeIndex = remember { derivedStateOf { eatery.getTypeMeal(weekDayIndex.fromOffsetToDayOfWeek()) - ?.indexOfFirst { it.first == nextEvent?.description } ?: 0 + ?.indexOfFirst { it.first == nextEvent?.description } + ?.coerceAtLeast(0) ?: 0 } } From 77f104a290717152e35d7d750bfbb41cac009798 Mon Sep 17 00:00:00 2001 From: thisjustin123 Date: Sun, 27 Oct 2024 22:46:01 -0400 Subject: [PATCH 2/2] Update whats new and version code --- app/build.gradle | 4 ++-- whatsnew/whatsnew-en-US | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bac53ca..5c0c085 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,8 +23,8 @@ android { applicationId "com.cornellappdev.android.eatery" minSdk 28 targetSdk 34 - versionCode 71 - versionName "1.1-compare-menus" + versionCode 72 + versionName "1.2-compare-menus" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/whatsnew/whatsnew-en-US b/whatsnew/whatsnew-en-US index a150f11..f9151d4 100644 --- a/whatsnew/whatsnew-en-US +++ b/whatsnew/whatsnew-en-US @@ -1,4 +1,7 @@ We're working hard to bring you the latest fixes and features to Eatery! Here's what we've been working on: +* Fixed a crash on opening certain eatery detail screens related to menu selection. + +Previous Notes: * Compare Menus - Click the Compare Menus button on the main menu or eatery detail screen to compare menus across several eateries! * Home Screen UI Reorganization - Eateries nearest to you are now more intuitive to find. -* Menu Selection - Select the top bar on a eatery menu to swap from breakfast, lunch, and dinner! +* Menu Selection - Select the top bar on a eatery menu to swap from breakfast, lunch, and dinner