Fix: Completion being called consecutively

fix #29
This commit is contained in:
Flávio Caetano 2018-03-07 17:44:14 -03:00
parent 678da21e63
commit cab34b882f
1 changed files with 2 additions and 0 deletions

View File

@ -77,6 +77,8 @@ open class ReCaptchaWebViewManager {
/// Flag the requests as finished and call ReCaptcha execution if necessary
func execute() {
guard manager?.didFinishLoading != true else { return }
DispatchQueue.main.throttle(deadline: .now() + 1, context: self) { [weak self] in
// Did finish loading the ReCaptcha JS source
self?.manager?.didFinishLoading = true