@capgo/capacitor-inappbrowser 8.12.0 → 8.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -230,7 +230,7 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
230
230
  case aware = "AWARE"
231
231
  case fakeVisible = "FAKE_VISIBLE"
232
232
  }
233
- private let pluginVersion: String = "8.12.0"
233
+ private let pluginVersion: String = "8.12.1"
234
234
  public let identifier = "CapgoInAppBrowserPlugin"
235
235
  public let jsName = "CapgoInAppBrowser"
236
236
  public let pluginMethods: [CAPPluginMethod] = [
@@ -611,7 +611,7 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
611
611
  webViewController.shouldPresentAsFramedOverlay {
612
612
  dismissActiveKeyboard()
613
613
  if presentNavigationControllerAsFramedOverlay(id: resolvedId) {
614
- self.currentPluginCall?.resolve()
614
+ // openWebView resolves with the webView id; do not resolve here.
615
615
  return true
616
616
  }
617
617
  self.currentPluginCall?.reject("Failed to present webview")
@@ -625,9 +625,9 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
625
625
  dismissActiveKeyboard()
626
626
  let presenter = self.bridge?.viewController?.presentedViewController ?? self.bridge?.viewController
627
627
  presentNavigationControllerSafely(navigationController, from: presenter, animated: isAnimated) { presented in
628
- if presented {
629
- self.currentPluginCall?.resolve()
630
- } else {
628
+ if !presented {
629
+ // openWebView already resolves with the webView id on success.
630
+ // Resolving here caused a double-resolve (empty, then with id). See #631.
631
631
  self.currentPluginCall?.reject("Failed to present webview")
632
632
  }
633
633
  }
@@ -1619,6 +1619,10 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
1619
1619
  }
1620
1620
  }
1621
1621
  call.resolve(["id": webViewId])
1622
+ // Only clear if this call still owns the slot (overlapping openWebView races).
1623
+ if self.currentPluginCall === call {
1624
+ self.currentPluginCall = nil
1625
+ }
1622
1626
  }
1623
1627
  }
1624
1628
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-inappbrowser",
3
- "version": "8.12.0",
3
+ "version": "8.12.1",
4
4
  "description": "Capacitor plugin in app browser",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",