AEB-55 / Добавлены лого и иконки
This commit is contained in:
@@ -25,7 +25,7 @@ export class NavigationService {
|
||||
|
||||
init(router: ReturnType<typeof useRouter>, navigationStore: NavigationStore) {
|
||||
if (this.initialized) {
|
||||
return // Prevent multiple initializations
|
||||
return // Предотвращаем повторную инициализацию
|
||||
}
|
||||
this.router = router
|
||||
this.navigationStore = navigationStore
|
||||
@@ -37,7 +37,7 @@ export class NavigationService {
|
||||
}
|
||||
|
||||
navigateToRoute(route: MainRoutes) {
|
||||
// Clear any active submenus when navigating to a different route
|
||||
// Убираем суб-меню перед переходом на другую страницу
|
||||
if (route !== MainRoutes.NAVIGATION) {
|
||||
this.navigationStore.setCurrentSubmenu(null)
|
||||
}
|
||||
@@ -80,8 +80,7 @@ export const navigationService = new NavigationService()
|
||||
export function useNavigationService() {
|
||||
const router = useRouter()
|
||||
const navigationStore = useNavigationStore()
|
||||
|
||||
// Initialize only once per component lifecycle
|
||||
|
||||
React.useMemo(() => {
|
||||
if (!navigationService.isInitialized()) {
|
||||
navigationService.init(router, navigationStore)
|
||||
|
||||
Reference in New Issue
Block a user