Fix unreachable code (god I hope this will not break updates)

This commit is contained in:
Zakhar Timoshenko
2022-07-22 23:55:56 +03:00
parent 9f21f5900f
commit fc3ec644b3

View File

@@ -102,14 +102,14 @@ class Tracker(
val newChapters = chapters.takeLastWhile { x -> x.id != track.lastChapterId }
return when {
newChapters.isEmpty() -> {
return MangaUpdates(manga, emptyList(), isValid = chapters.lastOrNull()?.id == track.lastChapterId)
MangaUpdates(manga, emptyList(), isValid = chapters.lastOrNull()?.id == track.lastChapterId)
}
newChapters.size == chapters.size -> {
return MangaUpdates(manga, emptyList(), isValid = false)
MangaUpdates(manga, emptyList(), isValid = false)
}
else -> {
return MangaUpdates(manga, newChapters, isValid = true)
MangaUpdates(manga, newChapters, isValid = true)
}
}
}
}
}