really fixed duplicate issue with Related titles row

This commit is contained in:
Cuong-Tran 2024-07-02 13:50:26 +07:00
parent a32316ddb4
commit a8e65dd63a
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2

View file

@ -2054,11 +2054,17 @@ sealed interface RelatedManga {
return map { relatedManga ->
if (relatedManga is Success) {
val stripedList = relatedManga.mangaList.mapNotNull {
if (!mangaIds.contains(it.id)) {
mangaIds.add(it.id)
it
} else {
null
}
}
Success(
relatedManga.keyword,
relatedManga.mangaList
.filterNot { mangaIds.contains(it.id) }
.onEach { mangaIds.add(it.id) },
stripedList,
)
} else {
relatedManga