sanity 3.71.1 → 3.71.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.
@@ -1641,10 +1641,14 @@ const MotionFlex = framerMotion.motion.create(ui.Flex), Preview = React.memo(Rea
1641
1641
  perspective,
1642
1642
  viewport,
1643
1643
  vercelProtectionBypass
1644
- } = props, previewUrl = React.useMemo(() => {
1644
+ } = props, [stablePerspective, setStablePerspective] = React.useState(null), urlPerspective = stablePerspective === null ? perspective : stablePerspective, previewUrl = React.useMemo(() => {
1645
1645
  const url = new URL(initialUrl);
1646
- return url.searchParams.get(constants.urlSearchParamPreviewPerspective) || url.searchParams.set(constants.urlSearchParamPreviewPerspective, perspective), (vercelProtectionBypass || url.searchParams.get(constants.urlSearchParamVercelProtectionBypass)) && url.searchParams.set(constants.urlSearchParamVercelSetBypassCookie, "samesitenone"), vercelProtectionBypass && !url.searchParams.get(constants.urlSearchParamVercelProtectionBypass) && url.searchParams.set(constants.urlSearchParamVercelProtectionBypass, vercelProtectionBypass), url;
1647
- }, [initialUrl, perspective, vercelProtectionBypass]), {
1646
+ return url.searchParams.get(constants.urlSearchParamPreviewPerspective) || url.searchParams.set(constants.urlSearchParamPreviewPerspective, urlPerspective), (vercelProtectionBypass || url.searchParams.get(constants.urlSearchParamVercelProtectionBypass)) && url.searchParams.set(constants.urlSearchParamVercelSetBypassCookie, "samesitenone"), vercelProtectionBypass && !url.searchParams.get(constants.urlSearchParamVercelProtectionBypass) && url.searchParams.set(constants.urlSearchParamVercelProtectionBypass, vercelProtectionBypass), url;
1647
+ }, [initialUrl, urlPerspective, vercelProtectionBypass]);
1648
+ React.useEffect(() => {
1649
+ loadersConnection === "connected" && setStablePerspective((prev) => prev === null ? perspective : prev);
1650
+ }, [loadersConnection, perspective]);
1651
+ const {
1648
1652
  t
1649
1653
  } = sanity.useTranslation(presentation.presentationLocaleNamespace), {
1650
1654
  devMode