Proper check for when to navigate to tracker settings from tracking action

This commit is contained in:
arkon 2023-12-14 19:52:49 -05:00
parent e56bf82c31
commit d20a8fcf13
2 changed files with 2 additions and 2 deletions

View file

@ -132,7 +132,7 @@ class MangaScreen(
) )
}.takeIf { isHttpSource }, }.takeIf { isHttpSource },
onTrackingClicked = { onTrackingClicked = {
if (successState.trackingCount == 0) { if (screenModel.loggedInTrackers.isEmpty()) {
navigator.push(SettingsScreen(SettingsScreen.Destination.Tracking)) navigator.push(SettingsScreen(SettingsScreen.Destination.Tracking))
} else { } else {
screenModel.showTrackDialog() screenModel.showTrackDialog()

View file

@ -118,7 +118,7 @@ class MangaScreenModel(
private val successState: State.Success? private val successState: State.Success?
get() = state.value as? State.Success get() = state.value as? State.Success
private val loggedInTrackers by lazy { trackerManager.trackers.filter { it.isLoggedIn } } val loggedInTrackers by lazy { trackerManager.trackers.filter { it.isLoggedIn } }
val manga: Manga? val manga: Manga?
get() = successState?.manga get() = successState?.manga