Skip to content

Commit 6084e8f

Browse files
Adressed comment
1 parent 661e696 commit 6084e8f

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

  • app/src/main/java/com/cornellappdev/uplift/ui/components/general

app/src/main/java/com/cornellappdev/uplift/ui/components/general/ConfettiBurst.kt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import androidx.compose.ui.graphics.drawscope.withTransform
1717
import com.cornellappdev.uplift.ui.theme.ConfettiColors
1818
import kotlinx.coroutines.delay
1919
import com.cornellappdev.uplift.ui.viewmodels.profile.ConfettiViewModel
20-
import com.google.android.play.core.integrity.x
21-
import com.google.android.play.integrity.internal.y
2220
import kotlin.math.cos
2321
import kotlin.math.sin
2422
import kotlin.random.Random
@@ -85,8 +83,8 @@ fun ConfettiBurst(
8583

8684
var started by remember(uiState.showing) { mutableStateOf(false) }
8785

88-
LaunchedEffect(uiState.showing) {
89-
if (uiState.showing) started = true
86+
LaunchedEffect(Unit) {
87+
started = true
9088
}
9189

9290
// Progress 0 to 1 over 1.2s, used as time 't' in the physics below
@@ -126,11 +124,9 @@ fun ConfettiBurst(
126124
}
127125

128126

129-
LaunchedEffect(uiState.showing) {
130-
if (uiState.showing) {
131-
delay(1300)
132-
confettiViewModel.onAnimationFinished()
133-
}
127+
LaunchedEffect(Unit) {
128+
delay(1300)
129+
confettiViewModel.onAnimationFinished()
134130
}
135131

136132
//Renders ballistic motion + fade out for each particle

0 commit comments

Comments
 (0)