Skip to content

Commit e1d658c

Browse files
committed
fix: fix icon not displaying in evaluations fragment coming back from about fragment
1 parent 6029273 commit e1d658c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/src/main/java/com/klee/sapio/ui/view/EvaluationsFragment.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ class EvaluationsFragment : Fragment() {
201201

202202
if (state.iconUrl != null && !iconReady) {
203203
iconReady = true
204+
val needsCount = !state.isFullyLoaded
204205
if (state.iconUrl.isNotEmpty()) {
205206
Glide.with(requireContext().applicationContext)
206207
.load(EvaluationService.BASE_URL + state.iconUrl)
@@ -212,7 +213,7 @@ class EvaluationsFragment : Fragment() {
212213
dataSource: DataSource,
213214
isFirstResource: Boolean
214215
): Boolean {
215-
mViewModel.onIconDisplayed()
216+
if (needsCount) mViewModel.onIconDisplayed()
216217
return false
217218
}
218219

@@ -222,13 +223,13 @@ class EvaluationsFragment : Fragment() {
222223
target: Target<Drawable>,
223224
isFirstResource: Boolean
224225
): Boolean {
225-
mViewModel.onIconDisplayed()
226+
if (needsCount) mViewModel.onIconDisplayed()
226227
return false
227228
}
228229
})
229230
.into(mBinding.image)
230231
} else {
231-
mViewModel.onIconDisplayed()
232+
if (needsCount) mViewModel.onIconDisplayed()
232233
}
233234
}
234235
}
@@ -393,6 +394,7 @@ class EvaluationsFragment : Fragment() {
393394

394395
override fun onDestroyView() {
395396
super.onDestroyView()
397+
iconReady = false
396398
shareImage?.let {
397399
requireContext().contentResolver.delete(it, null, null)
398400
shareImage = null

0 commit comments

Comments
 (0)