add commnets

This commit is contained in:
Peter Maquiran
2022-01-29 20:21:51 +01:00
parent acacb58d0d
commit b06e155d20
2 changed files with 8 additions and 7 deletions
+6 -6
View File
@@ -11,7 +11,6 @@ import { SessionStore } from '../store/session.service';
import { AESEncrypt } from '../services/aesencrypt.service';
import { CookieService } from 'ngx-cookie-service';
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
import { ChatService } from './chat.service';
@Injectable({
providedIn: 'root'
})
@@ -32,8 +31,7 @@ export class AuthService {
public alertController: AlertController,
private aesencrypt: AESEncrypt,
private cookieService: CookieService,
private WsChatService: WsChatService,
private ChatService: ChatService) {
private WsChatService: WsChatService) {
this.headers = new HttpHeaders();
@@ -118,8 +116,6 @@ export class AuthService {
if(responseChat) {
setTimeout(()=>{
this.WsChatService.connect();
@@ -137,8 +133,12 @@ export class AuthService {
localStorage.setItem('userChat', JSON.stringify(responseChat));
this.storageService.store(AuthConnstants.AUTH, responseChat);
this.ChatService.setHeader()
if(window['setChatHeader']){
window['setChatHeader']()
}
return true;
}
else{
+2 -1
View File
@@ -33,9 +33,10 @@ export class ChatService {
)
{
this.setHeader()
window['setChatHeader'] = this.setHeader
}
setHeader() {
setHeader = () => {
this.loggedUserChat = this.authService.ValidatedUserChat;
this.headers = new HttpHeaders();
this.headers = this.headers.set('X-User-Id', this.loggedUserChat['data'].userId);