diff --git a/src/app/services/chat.service.ts b/src/app/services/chat.service.ts index ca97becee..1db701a39 100644 --- a/src/app/services/chat.service.ts +++ b/src/app/services/chat.service.ts @@ -340,18 +340,22 @@ export class ChatService { } setheader() { - if (this.p.userPermission(this.p.permissionList.Chat.access)) { - this.loggedUserChat = this.authService.ValidatedUserChat; - this.headers = new HttpHeaders(); - + try { if (this.p.userPermission(this.p.permissionList.Chat.access)) { - // - this.headers = this.headers.set('X-User-Id', SessionStore.user.ChatData.data.userId); - this.headers = this.headers.set('X-Auth-Token', SessionStore.user.ChatData.data.authToken); - this.options = { - headers: this.headers, - }; + this.loggedUserChat = this.authService.ValidatedUserChat; + this.headers = new HttpHeaders(); + + if (this.p.userPermission(this.p.permissionList.Chat.access)) { + // + this.headers = this.headers.set('X-User-Id', SessionStore.user.ChatData.data.userId); + this.headers = this.headers.set('X-Auth-Token', SessionStore.user.ChatData.data.authToken); + this.options = { + headers: this.headers, + }; + } } + } catch (error) { + console.log(error) } }