Skip to content

Commit

Permalink
[WBIOS-3030] Bugfix: Enable to use dismiss on old panda screens
Browse files Browse the repository at this point in the history
  • Loading branch information
YehorKyrylov committed May 25, 2023
1 parent 428b41c commit bbcd842
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/PandaSDK/Views/WebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ final class WebViewController: UIViewController, WKScriptMessageHandler {
wv.alpha = 0

if let html = html {
load(html: html, baseURL: URL(fileURLWithPath: Bundle.main.bundlePath))
load(
html: html,
baseURL: html.contains(Constants.oldDismiss) // We are still using old panda screens that do not yet use JS dismiss functions, so we need to check whether it is the old screen or the new
? nil
: URL(fileURLWithPath: Bundle.main.bundlePath)
)
}
}

Expand Down Expand Up @@ -829,5 +834,6 @@ extension WebViewController {

private enum Constants {
static let hideTrialJSFunctionName = "removeTrialUi()"
static let oldDismiss = "dismiss?type=dismiss"
}
}

0 comments on commit bbcd842

Please sign in to comment.