4
0
forked from crowetic/commerce

Remove no longer needed open checkout hook

This commit is contained in:
Luis Alvarez 2020-10-14 19:25:20 -05:00
parent ddf3a2a8b4
commit f498a708d3
2 changed files with 0 additions and 13 deletions

View File

@ -7,7 +7,6 @@ import { useUI } from '@components/ui/context'
import useCart from '@lib/bigcommerce/cart/use-cart'
import usePrice from '@lib/bigcommerce/use-price'
import CartItem from '../CartItem'
import useOpenCheckout from '@lib/bigcommerce/cart/use-open-checkout'
const CartSidebarView: FC = () => {
const { data, isEmpty } = useCart()
@ -23,7 +22,6 @@ const CartSidebarView: FC = () => {
currencyCode: data.currency.code,
}
)
const openCheckout = useOpenCheckout()
const { closeSidebar } = useUI()
const handleClose = () => closeSidebar()

View File

@ -1,11 +0,0 @@
import useCart from './use-cart'
export default function useOpenCheckout() {
const { data, mutate } = useCart()
return async function openCheckout() {
window.open(data?.redirect_urls.checkout_url)
// Get new redirect urls
await mutate()
}
}