aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/app.component.ts
diff options
context:
space:
mode:
authorDanijel Andjelkovic <adanijel99@gmail.com>2022-05-05 00:46:39 +0000
committerDanijel Andjelkovic <adanijel99@gmail.com>2022-05-05 00:46:39 +0000
commitc77c5289d01f1f02a57a060dc2166b449e597881 (patch)
treecb64f2775335cdd856e81ec9e8ba0bed93fa0985 /frontend/src/app/app.component.ts
parent6f48458e058d3e5a8d559adc22adbe78cba9a253 (diff)
parent15c60cb0c179d2d3c353ab3e19370e16d02176eb (diff)
Merge branch 'redesign' into 'master'
merge See merge request igrannonica/neuronstellar!29
Diffstat (limited to 'frontend/src/app/app.component.ts')
-rw-r--r--frontend/src/app/app.component.ts30
1 files changed, 11 insertions, 19 deletions
diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts
index 54c18bec..e301b46f 100644
--- a/frontend/src/app/app.component.ts
+++ b/frontend/src/app/app.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit } from '@angular/core';
+import { AfterViewInit, Component, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
import { filter, map } from 'rxjs';
@@ -11,9 +11,12 @@ import Shared from './Shared';
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
-export class AppComponent implements OnInit {
+export class AppComponent implements OnInit, AfterViewInit {
+ constructor(private router: Router, private titleService: Title, private authService: AuthService, private signalRService: SignalRService, private http: HttpClient) {
- constructor(private router: Router, private titleService: Title,private authService:AuthService,private signalRService:SignalRService,private http:HttpClient) { }
+ }
+ ngAfterViewInit(): void {
+ }
ngOnInit() {
this.router.events
@@ -36,22 +39,11 @@ export class AppComponent implements OnInit {
this.titleService.setTitle(`${title} - Igrannonica`);
}
});
- if(!this.authService.isAuthenticated())
- {
+ if (!this.authService.isAuthenticated()) {
+ if(!this.authService.alreadyGuest())
this.authService.addGuestToken();
- }
- this.signalRService.startConnection();
- //this.startHttpRequest();
-
-
-
-
- }
- private startHttpRequest = () => {
- this.http.get('http://localhost:5283/chatHub')
- .subscribe(res => {
- })
+ }
+ this.signalRService.startConnection();
+ //this.startHttpRequest();
}
-
-
}