Skip to content

Commit

Permalink
Await to finishe loading before executing
Browse files Browse the repository at this point in the history
  • Loading branch information
CursedMun committed Jul 12, 2024
1 parent 7893396 commit de0fc26
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/swift-ads-package/swift_ads_package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ extension SwiftAdsPackage: WKNavigationDelegate, WKUIDelegate {
// WKNavigationDelegate methods
public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
// Check if the URL is intended to be opened in an external browser
if (!finishedLoading) {
return;
}

if shouldBeOpenedInBrowser(url: navigationAction.request.url?.absoluteString ?? "") {

Expand Down

0 comments on commit de0fc26

Please sign in to comment.