Skip to content

Commit

Permalink
if expression over statement
Browse files Browse the repository at this point in the history
  • Loading branch information
kiftio committed Nov 22, 2023
1 parent 756cbb4 commit a405675
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/src/main/java/com/shopify/checkoutkit/CheckoutWebView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,16 @@ internal class CheckoutWebView(context: Context, attributeSet: AttributeSet? = n
}

override fun onRenderProcessGone(view: WebView, detail: RenderProcessGoneDetail): Boolean {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !detail.didCrash()) {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !detail.didCrash()) {
// Renderer was killed because system ran out of memory.

// Removing the view from `CheckoutWebViewContainer will trigger a cache clear
// and call webView.destroy()
(view.parent as ViewGroup).removeView(view)
return true
true
} else {
false
}
return false
}

override fun shouldOverrideUrlLoading(
Expand Down

0 comments on commit a405675

Please sign in to comment.