diff --git a/.DS_Store b/.DS_Store index a11ed7d..e4e593a 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/backend/medusa-config.ts b/backend/medusa-config.ts index ed40879..625ca2a 100644 --- a/backend/medusa-config.ts +++ b/backend/medusa-config.ts @@ -36,7 +36,7 @@ export default defineConfig({ }, }, { - resolve: "@medusajs/medusa/file", + resolve: "@medusajs/file", key: Modules.FILE, options: { providers: [ @@ -44,9 +44,8 @@ export default defineConfig({ resolve: "@medusajs/medusa/file-s3", id: "s3", options: { + authentication_method: "s3-iam-role", file_url: process.env.S3_FILE_URL, - access_key_id: process.env.S3_ACCESS_KEY_ID, - secret_access_key: process.env.S3_SECRET_ACCESS_KEY, region: process.env.S3_REGION, bucket: process.env.S3_BUCKET, endpoint: process.env.S3_ENDPOINT, diff --git a/storefront/components/global/header/cart/cart-context.tsx b/storefront/components/global/header/cart/cart-context.tsx index 9a17c2f..b1d9909 100644 --- a/storefront/components/global/header/cart/cart-context.tsx +++ b/storefront/components/global/header/cart/cart-context.tsx @@ -36,6 +36,7 @@ const CartContext = createContext< lineItem: string, newQuantity: number, ) => Promise; + isUpdating: boolean; setCartOpen: Dispatch>; } | undefined @@ -120,7 +121,7 @@ export function CartProvider({ }); }); }, - [setCartOpen, setOptimisticCart], + [setCartOpen, setOptimisticCart, cart], ); useEffect(() => { @@ -186,6 +187,7 @@ export function CartProvider({ cartOpen, handleDeleteItem, handleUpdateCartQuantity, + isUpdating: JSON.stringify(cart) !== JSON.stringify(optimisticCart), setCartOpen, }} > diff --git a/storefront/components/global/header/cart/cart-footer.tsx b/storefront/components/global/header/cart/cart-footer.tsx index 355e3d1..ec2244f 100644 --- a/storefront/components/global/header/cart/cart-footer.tsx +++ b/storefront/components/global/header/cart/cart-footer.tsx @@ -1,13 +1,13 @@ "use client"; -import {Link} from "@/components/shared/button"; +import {Cta, Link} from "@/components/shared/button"; import Body from "@/components/shared/typography/body"; import {convertToLocale} from "@/utils/medusa/money"; import {useCart} from "./cart-context"; export default function CartFooter() { - const {cart} = useCart(); + const {cart, isUpdating} = useCart(); const item_total = cart ? convertToLocale({ @@ -39,10 +39,14 @@ export default function CartFooter() { )} - {!cartIsEmpty && ( + {!cartIsEmpty && !isUpdating ? ( Go to checkout + ) : ( + + Go to checkout + )}