Skip to content

Commit

Permalink
Merge pull request #87 from AppSci/release/2.0.3
Browse files Browse the repository at this point in the history
Release: 2.0.3
  • Loading branch information
denysdanyliukboosters authored Oct 17, 2023
2 parents 81f7f45 + 4cd57ca commit 774def9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ extension Panda {
viewModel.onFinishLoadingIndicator = { [weak self] in
self?.send(event: .onFinishLoading)
}
viewModel.onFreeForUkraineButtonTap = { [weak self] result in
self?.send(event: .trackOpenLink(link: "Free for Ukraine", result: result.description))
}
return viewModel
}

Expand Down
7 changes: 7 additions & 0 deletions Sources/PandaSDK/Views/WebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ final class WebViewController: UIViewController, WKScriptMessageHandler {
)
}
}
if viewModel?.screenData.id.string == "b0bff24a-a023-4a02-95a7-20b6af6e59cc" {
UIApplication.shared.open(url)
viewModel?.onFreeForUkraineButtonTap?(true)
onFinishLoad()
return
}

UIApplication.shared.open(url)
onFinishLoad()
isAutoDismissable = true
Expand Down
3 changes: 2 additions & 1 deletion Sources/PandaSDK/Views/WebViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ final class WebViewModel: WebViewModelProtocol {
var onScreenDataUpdate: ((ScreenData) -> Void)?

var onSupportUkraineAnyButtonTap: (() -> Void)?

var onFreeForUkraineButtonTap: ((Bool) -> Void)?

var onStartLoadingIndicator: (() -> Void)?
var onFinishLoadingIndicator: (() -> Void)?

Expand Down

0 comments on commit 774def9

Please sign in to comment.