Use unique keys for all screens to avoid crashes
Fixes #9008 Fixes #9110
This commit is contained in:
@@ -17,11 +17,10 @@ import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.core.net.toUri
|
||||
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.Navigator
|
||||
import cafe.adriel.voyager.navigator.currentOrThrow
|
||||
import eu.kanade.core.navigation.Screen
|
||||
import eu.kanade.domain.manga.model.hasCustomCover
|
||||
import eu.kanade.domain.manga.model.toSManga
|
||||
import eu.kanade.presentation.category.ChangeCategoryDialog
|
||||
@@ -60,12 +59,10 @@ import tachiyomi.presentation.core.components.LoadingScreen
|
||||
class MangaScreen(
|
||||
private val mangaId: Long,
|
||||
val fromSource: Boolean = false,
|
||||
) : Screen, AssistContentScreen {
|
||||
) : Screen(), AssistContentScreen {
|
||||
|
||||
private var assistUrl: String? = null
|
||||
|
||||
override val key = uniqueScreenKey
|
||||
|
||||
override fun onProvideAssistUrl() = assistUrl
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -32,10 +32,10 @@ import cafe.adriel.voyager.core.model.ScreenModel
|
||||
import cafe.adriel.voyager.core.model.StateScreenModel
|
||||
import cafe.adriel.voyager.core.model.coroutineScope
|
||||
import cafe.adriel.voyager.core.model.rememberScreenModel
|
||||
import cafe.adriel.voyager.core.screen.Screen
|
||||
import cafe.adriel.voyager.navigator.LocalNavigator
|
||||
import cafe.adriel.voyager.navigator.Navigator
|
||||
import cafe.adriel.voyager.navigator.currentOrThrow
|
||||
import eu.kanade.core.navigation.Screen
|
||||
import eu.kanade.domain.chapter.interactor.SyncChaptersWithTrackServiceTwoWay
|
||||
import eu.kanade.domain.track.model.toDbTrack
|
||||
import eu.kanade.domain.track.model.toDomainTrack
|
||||
@@ -83,7 +83,7 @@ data class TrackInfoDialogHomeScreen(
|
||||
private val mangaId: Long,
|
||||
private val mangaTitle: String,
|
||||
private val sourceId: Long,
|
||||
) : Screen {
|
||||
) : Screen() {
|
||||
|
||||
@Composable
|
||||
override fun Content() {
|
||||
@@ -265,7 +265,7 @@ data class TrackInfoDialogHomeScreen(
|
||||
private data class TrackStatusSelectorScreen(
|
||||
private val track: Track,
|
||||
private val serviceId: Long,
|
||||
) : Screen {
|
||||
) : Screen() {
|
||||
|
||||
@Composable
|
||||
override fun Content() {
|
||||
@@ -314,7 +314,7 @@ private data class TrackStatusSelectorScreen(
|
||||
private data class TrackChapterSelectorScreen(
|
||||
private val track: Track,
|
||||
private val serviceId: Long,
|
||||
) : Screen {
|
||||
) : Screen() {
|
||||
|
||||
@Composable
|
||||
override fun Content() {
|
||||
@@ -369,7 +369,7 @@ private data class TrackChapterSelectorScreen(
|
||||
private data class TrackScoreSelectorScreen(
|
||||
private val track: Track,
|
||||
private val serviceId: Long,
|
||||
) : Screen {
|
||||
) : Screen() {
|
||||
|
||||
@Composable
|
||||
override fun Content() {
|
||||
@@ -420,7 +420,7 @@ private data class TrackDateSelectorScreen(
|
||||
private val track: Track,
|
||||
private val serviceId: Long,
|
||||
private val start: Boolean,
|
||||
) : Screen {
|
||||
) : Screen() {
|
||||
|
||||
@Composable
|
||||
override fun Content() {
|
||||
@@ -514,7 +514,7 @@ private data class TrackDateRemoverScreen(
|
||||
private val track: Track,
|
||||
private val serviceId: Long,
|
||||
private val start: Boolean,
|
||||
) : Screen {
|
||||
) : Screen() {
|
||||
|
||||
@Composable
|
||||
override fun Content() {
|
||||
@@ -597,7 +597,7 @@ data class TrackServiceSearchScreen(
|
||||
private val initialQuery: String,
|
||||
private val currentUrl: String?,
|
||||
private val serviceId: Long,
|
||||
) : Screen {
|
||||
) : Screen() {
|
||||
|
||||
@Composable
|
||||
override fun Content() {
|
||||
|
||||
Reference in New Issue
Block a user