Skip to content

Commit

Permalink
GlobalSearchScreen: Add unique key (#8693)
Browse files Browse the repository at this point in the history
Avoids crash when an old screen is being replaced by a new one
  • Loading branch information
ivaniskandar committed Dec 7, 2022
1 parent a3f3f9d commit f05e251
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import cafe.adriel.voyager.core.model.rememberScreenModel
import cafe.adriel.voyager.core.screen.Screen
import cafe.adriel.voyager.core.screen.uniqueScreenKey
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import eu.kanade.presentation.browse.GlobalSearchScreen
Expand All @@ -16,6 +17,8 @@ class GlobalSearchScreen(
val extensionFilter: String = "",
) : Screen {

override val key = uniqueScreenKey

@Composable
override fun Content() {
val navigator = LocalNavigator.currentOrThrow
Expand Down

0 comments on commit f05e251

Please sign in to comment.