@swipefindercom/finder-sdk 1.0.24 → 1.0.26

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.
@@ -25045,6 +25045,10 @@ const SwipeableFeed = ({
25045
25045
  const [isCardReady, setIsCardReady] = useState({});
25046
25046
  const [tutorialXOffset, setTutorialXOffset] = useState(0);
25047
25047
  const containerRef = useRef(null);
25048
+ const isMutedRef = useRef(isMuted);
25049
+ useEffect(() => {
25050
+ isMutedRef.current = isMuted;
25051
+ }, [isMuted]);
25048
25052
  const finishTutorial = useCallback(() => {
25049
25053
  setTutorialXOffset(0);
25050
25054
  hideTutorial == null ? void 0 : hideTutorial();
@@ -25083,7 +25087,7 @@ const SwipeableFeed = ({
25083
25087
  if (video.play) {
25084
25088
  await video.play();
25085
25089
  }
25086
- video.muted = isMuted;
25090
+ video.muted = isMutedRef.current;
25087
25091
  } catch (error) {
25088
25092
  if (retryCount < maxRetries) {
25089
25093
  retryCount++;
@@ -25100,7 +25104,7 @@ const SwipeableFeed = ({
25100
25104
  } catch (error) {
25101
25105
  console.warn("Video playback setup error:", error);
25102
25106
  }
25103
- }, [isMuted]);
25107
+ }, []);
25104
25108
  const displayedCards = useMemo(() => {
25105
25109
  return cards.slice(currentCardIndex, currentCardIndex + maxVisibleCards);
25106
25110
  }, [cards, currentCardIndex, maxVisibleCards]);
@@ -27439,12 +27443,12 @@ class DataService {
27439
27443
  }
27440
27444
  }
27441
27445
  function initSwipeFinder(options) {
27442
- const { backendUrl, finderId, element, ...config } = options;
27446
+ const { backendUrl, finderId, element, dataService: customDataService, ...config } = options;
27443
27447
  if (!element || !(element instanceof HTMLElement)) {
27444
27448
  throw new Error("Invalid element provided. Must be an HTMLElement.");
27445
27449
  }
27446
27450
  const monitorService = new MonitorService();
27447
- const dataService = new DataService();
27451
+ const dataService = customDataService ?? new DataService();
27448
27452
  const root = createRoot(element);
27449
27453
  root.render(
27450
27454
  React.createElement(MainBootstrap, {