Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jayohms committed Jan 30, 2021
1 parent d83f055 commit f3c1cdf
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -373,15 +373,15 @@ internal class TurboWebFragmentDelegate(
turboView.webViewRefresh?.apply {
isEnabled = navDestination.pathProperties.pullToRefreshEnabled
setOnRefreshListener {
refresh(true)
refresh(displayProgress = true)
}
}
}

private fun initializeErrorPullToRefresh(turboView: TurboView) {
turboView.errorRefresh?.apply {
setOnRefreshListener {
refresh(true)
refresh(displayProgress = true)
}
}
}
Expand Down

0 comments on commit f3c1cdf

Please sign in to comment.