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);
|
||||
|
||||
useEffect(() => {
|
||||
if (!initialized) {
|
||||
if (!initialized && locale) {
|
||||
// Set language code before initializing checkout
|
||||
useSaleorCheckoutStore.getState().setLanguageCode(locale);
|
||||
initCheckout();
|
||||
setInitialized(true);
|
||||
}
|
||||
}, [initialized]);
|
||||
}, [initialized, locale]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpen) {
|
||||
|
||||
Reference in New Issue
Block a user