Skip to content

Commit 1a46027

Browse files
committed
Bug fix: Sorted games not provided correctly
1 parent 72b1531 commit 1a46027

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

composeApp/src/commonMain/kotlin/net/solvetheriddle/roundtimer/ui/screens/GamesScreen.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ import androidx.compose.ui.unit.sp
6464
import kotlinx.coroutines.launch
6565
import net.solvetheriddle.roundtimer.model.Game
6666
import net.solvetheriddle.roundtimer.model.TimerState
67+
import net.solvetheriddle.roundtimer.model.sortedChronologically
6768
import net.solvetheriddle.roundtimer.ui.components.SetAppropriateStatusBarColor
6869
import net.solvetheriddle.roundtimer.ui.utils.rememberIsLandscape
6970

@@ -88,6 +89,10 @@ fun GamesScreen(
8889
val snackbarHostState = remember { SnackbarHostState() }
8990
val scope = rememberCoroutineScope()
9091

92+
val sortedGames = remember(state.games) {
93+
state.games.sortedChronologically()
94+
}
95+
9196
SetAppropriateStatusBarColor()
9297

9398
if (showEditDialog && gameToEdit != null) {
@@ -128,10 +133,6 @@ fun GamesScreen(
128133

129134
val isLandscape = rememberIsLandscape()
130135

131-
val sortedGames = remember(state.games) {
132-
state.games.sortedChronologically()
133-
}
134-
135136
Scaffold(
136137
snackbarHost = { SnackbarHost(snackbarHostState) },
137138
topBar = {

composeApp/src/commonMain/kotlin/net/solvetheriddle/roundtimer/viewmodel/TimerViewModel.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import net.solvetheriddle.roundtimer.model.ScheduledSound
2727
import net.solvetheriddle.roundtimer.model.Sound
2828
import net.solvetheriddle.roundtimer.model.Round
2929
import net.solvetheriddle.roundtimer.model.TimerState
30+
import net.solvetheriddle.roundtimer.model.sortedChronologically
3031
import net.solvetheriddle.roundtimer.platform.getScreenLocker
3132
import net.solvetheriddle.roundtimer.platform.getSoundPlayer
3233
import net.solvetheriddle.roundtimer.platform.getAnalyticsService

0 commit comments

Comments
 (0)