From 2dae706198a4f9a37b25fb2c156bef1a3af67762 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 12 Feb 2021 17:31:17 -0500 Subject: [PATCH] Avoid crash when source list is animating --- .../eu/kanade/tachiyomi/ui/browse/source/SourceItem.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceItem.kt index c8bf4f9ea..c5a2094f9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceItem.kt @@ -49,12 +49,17 @@ data class SourceItem( override fun equals(other: Any?): Boolean { if (other is SourceItem) { - return source.id == other.source.id && getHeader()?.code == other.getHeader()?.code + return source.id == other.source.id && + getHeader()?.code == other.getHeader()?.code && + isPinned == other.isPinned } return false } override fun hashCode(): Int { - return source.id.hashCode() + (getHeader()?.code?.hashCode() ?: 0).toInt() + var result = source.id.hashCode() + result = 31 * result + (header?.hashCode() ?: 0) + result = 31 * result + isPinned.hashCode() + return result } }