changes are done

This commit is contained in:
sdarbinyan
2026-03-01 02:40:42 +04:00
parent ffde301181
commit e32ee998c1
16 changed files with 246 additions and 184 deletions

View File

@@ -1,8 +1,9 @@
import { Component, OnInit, signal } from '@angular/core';
import { Component, OnInit, signal, DestroyRef, inject } from '@angular/core';
import { Router } from '@angular/router';
import { CommonModule } from '@angular/common';
import { MatCardModule } from '@angular/material/card';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { ApiService } from '../../services';
import { Project } from '../../models';
import { LanguageService } from '../../services/language.service';
@@ -21,6 +22,8 @@ export class ProjectsDashboardComponent implements OnInit {
error = signal<string | null>(null);
currentProjectId = signal<string | null>(null);
private destroyRef = inject(DestroyRef);
constructor(
private apiService: ApiService,
private router: Router,
@@ -37,7 +40,7 @@ export class ProjectsDashboardComponent implements OnInit {
}
// Listen to route changes
this.router.events.subscribe(() => {
this.router.events.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
const segments = this.router.url.split('/');
if (segments[1] === 'project' && segments[2]) {
this.currentProjectId.set(segments[2]);