From f3c1cdf6506f02399392ed35e1198013df64a650 Mon Sep 17 00:00:00 2001 From: Jay Ohms Date: Sat, 30 Jan 2021 07:07:10 -0500 Subject: [PATCH] Code cleanup --- .../turbo/delegates/TurboWebFragmentDelegate.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/turbo/src/main/kotlin/dev/hotwire/turbo/delegates/TurboWebFragmentDelegate.kt b/turbo/src/main/kotlin/dev/hotwire/turbo/delegates/TurboWebFragmentDelegate.kt index 3610f5dd..dbf30f0b 100644 --- a/turbo/src/main/kotlin/dev/hotwire/turbo/delegates/TurboWebFragmentDelegate.kt +++ b/turbo/src/main/kotlin/dev/hotwire/turbo/delegates/TurboWebFragmentDelegate.kt @@ -130,9 +130,9 @@ internal class TurboWebFragmentDelegate( * [dev.hotwire.turbo.nav.TurboNavDestination.refresh] */ fun refresh(displayProgress: Boolean) { - turboView?.webViewRefresh?.let { - if (displayProgress && !it.isRefreshing) { - it.isRefreshing = true + turboView?.webViewRefresh?.apply { + if (displayProgress && !isRefreshing) { + isRefreshing = true } } @@ -373,7 +373,7 @@ internal class TurboWebFragmentDelegate( turboView.webViewRefresh?.apply { isEnabled = navDestination.pathProperties.pullToRefreshEnabled setOnRefreshListener { - refresh(true) + refresh(displayProgress = true) } } } @@ -381,7 +381,7 @@ internal class TurboWebFragmentDelegate( private fun initializeErrorPullToRefresh(turboView: TurboView) { turboView.errorRefresh?.apply { setOnRefreshListener { - refresh(true) + refresh(displayProgress = true) } } }