diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 587d052f0..7373f3c72 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -40,7 +40,7 @@ export class LoginPage implements OnInit { private clearStoreService: ClearStoreService, private changeProfileService: ChangeProfileService, public ThemeService: ThemeService, - private storageservice: StorageService, + private storageservice: StorageService ) {} ngOnInit() { diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 1911bc6de..797d25a9a 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -20,7 +20,7 @@ export class AuthService { headers: HttpHeaders; public ValidatedUser: UserSession; public wsValidatedUserChat:any; - public ValidatedUserChat:any; + public ValidatedUserChat:any = {} public isWsAuthenticated: boolean = false; opts:any; diff --git a/src/app/services/chat/ws-chat.service.ts b/src/app/services/chat/ws-chat.service.ts index 6de1931b8..bfcf3fa86 100644 --- a/src/app/services/chat/ws-chat.service.ts +++ b/src/app/services/chat/ws-chat.service.ts @@ -17,7 +17,10 @@ export class WsChatService { constructor() {} connect() { - if(this.ws.connected == true) { return false } + // dont connect if is already connected + if(this.ws.connected == true) { + return false + } this.ws.connect(); @@ -43,8 +46,12 @@ export class WsChatService { } login() { - - if(this.isLogin == true) { return new Promise((resolve, reject)=>{ resolve(this.loginResponse) }) } + // dont login if is already login + if(this.isLogin == true) { + return new Promise((resolve, reject)=>{ + resolve(this.loginResponse) + }) + } const requestId = uuidv4()