Skip to content

Commit

Permalink
fix(browser): call notifyListeners only when browser is dismissed (#2186
Browse files Browse the repository at this point in the history
)
  • Loading branch information
OS-martacarlos authored Sep 9, 2024
1 parent c61d011 commit aaa8658
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion browser/ios/Sources/BrowserPlugin/BrowserPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ public class CAPBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
return
}
implementation.browserEventDidOccur = { [weak self] (event) in
self?.notifyListeners(event.listenerEvent, data: nil)
if event == .finished {
self?.bridge?.dismissVC(animated: true, completion: {
self?.notifyListeners(event.listenerEvent, data: nil)
})
} else {
self?.notifyListeners(event.listenerEvent, data: nil)
}
}
// display
DispatchQueue.main.async { [weak self] in
Expand Down

0 comments on commit aaa8658

Please sign in to comment.