clear cart on logout
This commit is contained in:
@@ -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());
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user