Skip to content

Commit aaa8658

Browse files
fix(browser): call notifyListeners only when browser is dismissed (#2186)
1 parent c61d011 commit aaa8658

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

browser/ios/Sources/BrowserPlugin/BrowserPlugin.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ public class CAPBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
2929
return
3030
}
3131
implementation.browserEventDidOccur = { [weak self] (event) in
32-
self?.notifyListeners(event.listenerEvent, data: nil)
32+
if event == .finished {
33+
self?.bridge?.dismissVC(animated: true, completion: {
34+
self?.notifyListeners(event.listenerEvent, data: nil)
35+
})
36+
} else {
37+
self?.notifyListeners(event.listenerEvent, data: nil)
38+
}
3339
}
3440
// display
3541
DispatchQueue.main.async { [weak self] in

0 commit comments

Comments
 (0)