fix: set language code in CartDrawer before init
This commit is contained in:
@@ -33,11 +33,13 @@ export default function CartDrawer() {
|
|||||||
const [initialized, setInitialized] = useState(false);
|
const [initialized, setInitialized] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!initialized) {
|
if (!initialized && locale) {
|
||||||
|
// Set language code before initializing checkout
|
||||||
|
useSaleorCheckoutStore.getState().setLanguageCode(locale);
|
||||||
initCheckout();
|
initCheckout();
|
||||||
setInitialized(true);
|
setInitialized(true);
|
||||||
}
|
}
|
||||||
}, [initialized]);
|
}, [initialized, locale]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
|
|||||||
Reference in New Issue
Block a user