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