@magicfeedback/popup-sdk 1.17.0 → 1.17.2

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.
package/dist/index.mjs CHANGED
@@ -930,7 +930,7 @@ function createReactNativeRenderer() {
930
930
  }
931
931
 
932
932
  // src/ui/preload.ts
933
- var defaultLoader = () => import("./renderPopup-YCAQ3ODC.mjs");
933
+ var defaultLoader = () => import("./renderPopup-PQWJSBOY.mjs");
934
934
  var pending = null;
935
935
  function preloadRenderPopup(loader = defaultLoader) {
936
936
  if (pending) return pending;
@@ -1003,9 +1003,18 @@ var BrowserPopupRenderer = class {
1003
1003
  if (!this.container) return;
1004
1004
  this.visible = true;
1005
1005
  const container = this.container;
1006
- void import("./renderPopup-YCAQ3ODC.mjs").then(({ renderPopup }) => {
1007
- renderPopup(container, surveyId, productId, actions, emit, onClose, env, userId, style, sessionId, miniService, analyticsFeedbackSessionId, options);
1008
- });
1006
+ void import("./renderPopup-PQWJSBOY.mjs").then(
1007
+ ({ renderPopup }) => {
1008
+ renderPopup(container, surveyId, productId, actions, emit, onClose, env, userId, style, sessionId, miniService, analyticsFeedbackSessionId, options);
1009
+ },
1010
+ (error) => {
1011
+ this.visible = false;
1012
+ sdkWarn("[Deepdots] popup renderer failed to load:", error);
1013
+ }
1014
+ );
1015
+ }
1016
+ isShowing() {
1017
+ return this.visible;
1009
1018
  }
1010
1019
  hide() {
1011
1020
  this.visible = false;
@@ -2948,6 +2957,10 @@ var DeepdotsPopups = class {
2948
2957
  });
2949
2958
  }
2950
2959
  showDefinition(def) {
2960
+ if (this.renderer.isShowing?.()) {
2961
+ this.debug("Popup skipped: another popup is already open", def.id);
2962
+ return;
2963
+ }
2951
2964
  this.log("Showing popup (definition)", def);
2952
2965
  this.surveyToPopupId.set(def.surveyId, def.id);
2953
2966
  this.lastShown.set(def.id, Date.now());