aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_elements
diff options
context:
space:
mode:
authorSonja Galovic <galovicsonja@gmail.com>2022-04-20 01:42:35 +0200
committerSonja Galovic <galovicsonja@gmail.com>2022-04-20 01:42:35 +0200
commitc2f89352f3aaba991472f2ea5198d17d8ce97d47 (patch)
tree6dc94fbb6ca3fd45f94979cc077e5dc67acaeadb /frontend/src/app/_elements
parentcb6a492ab9a54777eb4583bfeb97f4c48442e16d (diff)
parentdecbc2dc6b583dcf11cccf77f057cc7ec7b52adc (diff)
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into dev
Diffstat (limited to 'frontend/src/app/_elements')
-rw-r--r--frontend/src/app/_elements/navbar/navbar.component.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/frontend/src/app/_elements/navbar/navbar.component.ts b/frontend/src/app/_elements/navbar/navbar.component.ts
index 368508ed..d5d1744f 100644
--- a/frontend/src/app/_elements/navbar/navbar.component.ts
+++ b/frontend/src/app/_elements/navbar/navbar.component.ts
@@ -4,6 +4,7 @@ import { AuthService } from '../../_services/auth.service';
import shared from 'src/app/Shared';
import { UserInfoService } from 'src/app/_services/user-info.service';
import { MatDialog } from '@angular/material/dialog';
+import { SignalRService } from 'src/app/_services/signal-r.service';
@Component({
selector: 'app-navbar',
@@ -15,11 +16,15 @@ export class NavbarComponent implements OnInit {
currentUrl: string;
shared = shared;
- constructor(public location: Location, private auth: AuthService, private userInfoService: UserInfoService, private matDialog: MatDialog) {
+ constructor(public location: Location, private auth: AuthService, private userInfoService: UserInfoService, private matDialog: MatDialog, private signalRService: SignalRService) {
shared.dialog = matDialog;
this.currentUrl = this.location.path();
this.location.onUrlChange(() => {
this.currentUrl = this.location.path();
+ });
+
+ this.auth.loggedInEvent.subscribe(_ => {
+ this.signalRService.startConnection();
})
}
@@ -34,5 +39,6 @@ export class NavbarComponent implements OnInit {
logOut() {
this.auth.logOut();
+ this.signalRService.stopConnection();
}
}