Skip to content

Commit

Permalink
add a Observable that triggers a refresh when called
Browse files Browse the repository at this point in the history
  • Loading branch information
nevio18324 authored and peggimann committed Oct 23, 2024
1 parent 611fff5 commit f9db625
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class CheckInHistoryDialogComponent implements OnInit {
});
dialogRef.afterClosed().subscribe(() => {
this.loadCheckInHistory();
this.refreshDataService.reloadKeyResultSubject.next();
this.refreshDataService.markDataRefresh();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export class KeyresultDetailComponent implements OnInit {
ngOnInit(): void {
this.keyResultId = this.getIdFromParams();
this.loadKeyResult(this.keyResultId);
this.refreshDataService.reloadKeyResultSubject.subscribe(() => {
this.loadKeyResult(this.keyResultId);
});
}

private getIdFromParams(): number {
Expand Down Expand Up @@ -181,7 +184,7 @@ export class KeyresultDetailComponent implements OnInit {
},
});
dialogRef.afterClosed().subscribe(() => {
this.loadKeyResult(this.keyResult$.getValue().id);
this.refreshDataService.reloadKeyResultSubject.next();
this.refreshDataService.markDataRefresh();
});
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/services/refresh-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DEFAULT_HEADER_HEIGHT_PX } from '../shared/constantLibary';
})
export class RefreshDataService {
public reloadOverviewSubject: Subject<void> = new Subject();
public reloadKeyResultSubject: Subject<void> = new Subject();

public quarterFilterReady: Subject<void> = new Subject<void>();
public teamFilterReady: Subject<void> = new Subject<void>();
Expand Down

0 comments on commit f9db625

Please sign in to comment.