authButton fixed
This commit is contained in:
@@ -3,10 +3,10 @@ import { create } from 'zustand';
|
|||||||
|
|
||||||
type CabinetNavZustand = {
|
type CabinetNavZustand = {
|
||||||
navItem: CabinetSection;
|
navItem: CabinetSection;
|
||||||
setNavItem: (item: string) => void;
|
setNavItem: (item: CabinetSection) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useCabinetNav = create<CabinetNavZustand>((set) => ({
|
export const useCabinetNav = create<CabinetNavZustand>((set) => ({
|
||||||
navItem: 'dashboard',
|
navItem: 'dashboard',
|
||||||
setNavItem: (item: string) => set({ navItem: item || 'dash' }),
|
setNavItem: (item: CabinetSection) => set({ navItem: item }),
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -111,7 +111,9 @@ function AuthButtons() {
|
|||||||
if (subItem.url !== '/cabinet') {
|
if (subItem.url !== '/cabinet') {
|
||||||
clearTokens();
|
clearTokens();
|
||||||
} else {
|
} else {
|
||||||
setNavItem(subItem.key);
|
setNavItem(
|
||||||
|
subItem.key as import('@/widgets/cabinet/lib/types').CabinetSection,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
item={subItem}
|
item={subItem}
|
||||||
|
|||||||
Reference in New Issue
Block a user