From 6ace50c3069c9c4cea579a5db79b2b35e710bf5e Mon Sep 17 00:00:00 2001 From: davidoskky Date: Tue, 7 Feb 2023 21:45:51 +0100 Subject: [PATCH] Review --- .../android/adapters/SourcesListAdapter.kt | 2 +- .../readerforselfossv2/model/SelfossModel.kt | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/adapters/SourcesListAdapter.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/adapters/SourcesListAdapter.kt index 49e3a3c..65ae592 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/adapters/SourcesListAdapter.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/adapters/SourcesListAdapter.kt @@ -61,7 +61,7 @@ class SourcesListAdapter( c.circularBitmapDrawable(itm.getIcon(repository.baseUrl), binding.itemImage) } - if (itm.error.isNullOrBlank()) { + if (!itm.error.isNullOrBlank()) { binding.errorText.visibility = View.VISIBLE binding.errorText.text = itm.error } else { diff --git a/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/model/SelfossModel.kt b/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/model/SelfossModel.kt index 673b316..e0733f1 100644 --- a/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/model/SelfossModel.kt +++ b/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/model/SelfossModel.kt @@ -96,24 +96,6 @@ class SelfossModel { params = null ) - fun update(sourceStat: SourceStats) { - if (this.id != sourceStat.id || this.title != sourceStat.title) { - throw Exception() - } - this.unread = sourceStat.unread - } - - fun update(sourceDetail: SourceDetail) { - if (this.id != sourceDetail.id || this.title != sourceDetail.title) { - throw Exception() - } - this.tags = sourceDetail.tags - this.spout = sourceDetail.spout - this.error = sourceDetail.error - this.icon = sourceDetail.icon - this.params = sourceDetail.params - } - fun update(source: Source) { if (this.id != source.id || this.title != source.title) { throw Exception()