@sonic-equipment/ui 260.0.4 → 260.0.5

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.
@@ -24,7 +24,7 @@ function ShippingPage() {
24
24
  const { createEcommerceEvent, dataLayer } = useDataLayer();
25
25
  const gaEventPushed = useRef(false);
26
26
  const { data: cart, error: errorFetchCart, isLoading: isLoadingCart, refetch: refetchCart, } = useFetchCurrentCart();
27
- const { data: session } = useFetchSession();
27
+ const { data: session, isLoading: isLoadingSession } = useFetchSession();
28
28
  const hasNoBillToAddress = hasNo(cart?.billTo?.address1);
29
29
  const isGuest = Boolean(session?.isGuest);
30
30
  const { countries, currentCountry: selectedCountry, isFetching: isLoadingCountries, } = useCountries({
@@ -39,7 +39,10 @@ function ShippingPage() {
39
39
  const { isLoading: isPatchingSession, mutate: patchSession } = usePatchSession();
40
40
  const { error: errorPatchBillingAddress, isError, isLoading: isPatching, isSuccess, mutate: patchShippingDetails, } = usePatchShippingDetails();
41
41
  const isAuthenticated = session?.isAuthenticated;
42
- const isLoading = isLoadingCart || isLoadingCountries || isLoadingFulfillmentMethods;
42
+ const isLoading = isLoadingCart ||
43
+ isLoadingCountries ||
44
+ isLoadingFulfillmentMethods ||
45
+ isLoadingSession;
43
46
  const { isNavigating, navigate } = useNavigate();
44
47
  const isPickup = Boolean(cart?.fulfillmentMethod.match(/pickup/i));
45
48
  useEffect(() => {
@@ -48,7 +51,9 @@ function ShippingPage() {
48
51
  return;
49
52
  if (isAuthenticated === undefined)
50
53
  return;
51
- if (!isAuthenticated)
54
+ if (isLoading)
55
+ return;
56
+ if (isAuthenticated === false)
52
57
  return navigate(paths.CHECKOUT_SHIPPING_VIA_SIGNIN);
53
58
  if (hasNo(cart))
54
59
  return;
@@ -56,7 +61,7 @@ function ShippingPage() {
56
61
  return navigate(paths.CART);
57
62
  if (hasNo(cart.billTo))
58
63
  return navigate(paths.CHECKOUT_SHIPPING_VIA_SIGNIN);
59
- }, [cart, navigate, isAuthenticated, isNavigating, paths]);
64
+ }, [cart, navigate, isAuthenticated, isNavigating, paths, isLoading]);
60
65
  useEffect(() => {
61
66
  /* Guards for when the bill to address is saved and we should navigate to the next page */
62
67
  if (isPatching)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "260.0.4",
3
+ "version": "260.0.5",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {