aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_elements/dataset-load
diff options
context:
space:
mode:
authorDanijel Anđelković <adanijel99@gmail.com>2022-04-19 21:44:08 +0200
committerDanijel Anđelković <adanijel99@gmail.com>2022-04-19 21:45:03 +0200
commit32d776709f2b5df14dbcfd3f610306a899959851 (patch)
treec3f90bd8efe0ffe8895cae52e3787851f527dab2 /frontend/src/app/_elements/dataset-load
parent2c68a5c7926bfb62902ef9ad4b705d675c2293f7 (diff)
Dodao event kada se korisnik uloguje tako da komponente koje treba da osveze vrednost mogu da osveze svoje vrednosti tako sto se prijave na taj event.
Diffstat (limited to 'frontend/src/app/_elements/dataset-load')
-rw-r--r--frontend/src/app/_elements/dataset-load/dataset-load.component.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/frontend/src/app/_elements/dataset-load/dataset-load.component.ts b/frontend/src/app/_elements/dataset-load/dataset-load.component.ts
index 73dbf2d2..74640782 100644
--- a/frontend/src/app/_elements/dataset-load/dataset-load.component.ts
+++ b/frontend/src/app/_elements/dataset-load/dataset-load.component.ts
@@ -8,6 +8,7 @@ import { DatasetsService } from 'src/app/_services/datasets.service';
import { CsvParseService } from 'src/app/_services/csv-parse.service';
import { Output, EventEmitter } from '@angular/core';
import { SignalRService } from 'src/app/_services/signal-r.service';
+import { AuthService } from 'src/app/_services/auth.service';
@Component({
selector: 'app-dataset-load',
@@ -33,7 +34,15 @@ export class DatasetLoadComponent implements OnInit {
term: string = "";
- constructor(private models: ModelsService, private datasets: DatasetsService, private csv: CsvParseService, private signalRService: SignalRService) {
+ constructor(private models: ModelsService, private datasets: DatasetsService, private csv: CsvParseService, private signalRService: SignalRService, private authService: AuthService) {
+ this.fetchDatasets();
+
+ authService.loggedInEvent.subscribe(_ => {
+ this.fetchDatasets();
+ })
+ }
+
+ fetchDatasets() {
this.datasets.getMyDatasets().subscribe((datasets) => {
this.myDatasets = datasets;
});