clear cart on logout

This commit is contained in:
2026-01-14 15:28:02 +03:00
parent e95411460f
commit a337ee11e2

View File

@@ -9,6 +9,7 @@ import LoyaltyAndRewardIcon from "components/Icons/LoyaltyAndRewardIcon";
import MyOrderIcon from "components/Icons/MyOrderIcon";
import { logoutThunk } from "features/auth/authSlice";
import { setLocale, setLocalesThunk } from "features/locale/localeSlice";
import { clearCart } from "features/order/orderSlice";
import { toggleTheme } from "features/theme/themeSlice";
import i18n from "i18n/i18n";
import { useTranslation } from "react-i18next";
@@ -106,6 +107,7 @@ export default function useHeaderMenu() {
label: <div>{t("common.logout")}</div>,
onClick: () => {
dispatch(logoutThunk());
dispatch(clearCart());
},
},
]