Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHNL-16215] add preloading logic #256

Merged
merged 14 commits into from
Jan 21, 2025
Prev Previous commit
Next Next commit
check if website is loading or loaded before attempting to load again
ab1470 committed Jan 21, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ed30f72ff70869e5bbbc761afcd9da673138318f
Original file line number Diff line number Diff line change
@@ -54,8 +54,11 @@ class KlaviyoWebViewController: UIViewController, WKUIDelegate, KlaviyoWebViewDe

override func viewDidLoad() {
super.viewDidLoad()
let request = URLRequest(url: viewModel.url)
webView.load(request)

guard !webView.isLoading,
webView.estimatedProgress != 1.0 else { return }

loadUrl()
}

override func viewDidDisappear(_ animated: Bool) {