improvements are done
This commit is contained in:
@@ -17,6 +17,7 @@ export class ProjectsDashboardComponent implements OnInit {
|
||||
projects = signal<Project[]>([]);
|
||||
loading = signal(true);
|
||||
error = signal<string | null>(null);
|
||||
currentProjectId = signal<string | null>(null);
|
||||
|
||||
constructor(
|
||||
private apiService: ApiService,
|
||||
@@ -25,6 +26,22 @@ export class ProjectsDashboardComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.loadProjects();
|
||||
|
||||
// Check if we're currently viewing a project
|
||||
const urlSegments = this.router.url.split('/');
|
||||
if (urlSegments[1] === 'project' && urlSegments[2]) {
|
||||
this.currentProjectId.set(urlSegments[2]);
|
||||
}
|
||||
|
||||
// Listen to route changes
|
||||
this.router.events.subscribe(() => {
|
||||
const segments = this.router.url.split('/');
|
||||
if (segments[1] === 'project' && segments[2]) {
|
||||
this.currentProjectId.set(segments[2]);
|
||||
} else {
|
||||
this.currentProjectId.set(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
loadProjects() {
|
||||
|
||||
Reference in New Issue
Block a user