chore(globalsearch): Save initial mangaId just in case

This commit is contained in:
Ahmad Ansori Palembani 2024-12-16 12:22:21 +07:00
parent 8ec29bf755
commit 50cad86c0c
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -21,6 +21,7 @@ class GlobalSearchMangaItem(
private val getManga: GetManga by injectLazy()
val mangaId: Long? = initialManga.id
var manga: Manga = initialManga
private set
// TODO: Could potentially cause memleak, test it with leakcanary before deploying to stable!
@ -62,12 +63,12 @@ class GlobalSearchMangaItem(
override fun equals(other: Any?): Boolean {
if (other is GlobalSearchMangaItem) {
return manga.id == other.manga.id
return mangaId == other.mangaId
}
return false
}
override fun hashCode(): Int {
return manga.id?.toInt() ?: 0
return mangaId?.toInt() ?: 0
}
}