@skippr/live-agent-sdk 0.85.0 → 0.86.0

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.
@@ -3125,6 +3125,7 @@ function DomCapture({ pushOrTapMicMode = false }) {
3125
3125
  let cancelled = false;
3126
3126
  let snapshotInFlight = false;
3127
3127
  let a11yPublishInFlight = false;
3128
+ let a11yPublishPending = false;
3128
3129
  let consecutiveCaptureFailures = 0;
3129
3130
  if (!pushOrTapMicMode && !localParticipant.isMicrophoneEnabled) {
3130
3131
  localParticipant.setMicrophoneEnabled(true).catch((error) => console.error("Failed to enable microphone:", error));
@@ -3162,8 +3163,12 @@ function DomCapture({ pushOrTapMicMode = false }) {
3162
3163
  }
3163
3164
  };
3164
3165
  const tickA11yPublish = async () => {
3165
- if (cancelled || a11yPublishInFlight || pausedRef.current)
3166
+ if (cancelled || pausedRef.current)
3166
3167
  return;
3168
+ if (a11yPublishInFlight) {
3169
+ a11yPublishPending = true;
3170
+ return;
3171
+ }
3167
3172
  a11yPublishInFlight = true;
3168
3173
  try {
3169
3174
  const frame = await buildDomSnapshotFrame();
@@ -3175,6 +3180,10 @@ function DomCapture({ pushOrTapMicMode = false }) {
3175
3180
  });
3176
3181
  } catch {} finally {
3177
3182
  a11yPublishInFlight = false;
3183
+ if (a11yPublishPending && !cancelled) {
3184
+ a11yPublishPending = false;
3185
+ tickA11yPublish();
3186
+ }
3178
3187
  }
3179
3188
  };
3180
3189
  const cleanupDomEventListeners = installDomEventListeners(localParticipant, {