From 1a257e2696f48f507a1d8ea18e03402e6ae4c2b0 Mon Sep 17 00:00:00 2001 From: Jaehwa Noh Date: Fri, 8 Dec 2023 20:52:07 +0900 Subject: [PATCH] Remove useless State variable. --- .../main/java/com/example/dessertclicker/MainActivity.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/example/dessertclicker/MainActivity.kt b/app/src/main/java/com/example/dessertclicker/MainActivity.kt index ba14595..a694e3c 100644 --- a/app/src/main/java/com/example/dessertclicker/MainActivity.kt +++ b/app/src/main/java/com/example/dessertclicker/MainActivity.kt @@ -172,13 +172,11 @@ private fun DessertClickerApp( var revenue by rememberSaveable { mutableStateOf(0) } var dessertsSold by rememberSaveable { mutableStateOf(0) } - val currentDessertIndex by rememberSaveable { mutableStateOf(0) } - var currentDessertPrice by rememberSaveable { - mutableStateOf(desserts[currentDessertIndex].price) + mutableStateOf(desserts.first().price) } var currentDessertImageId by rememberSaveable { - mutableStateOf(desserts[currentDessertIndex].imageId) + mutableStateOf(desserts.first().imageId) } Scaffold(