Merge branch 'feature/websocket' of https://bitbucket.org/equilibriumito/gabinete-digital into feature/websocket

This commit is contained in:
tiago.kayaya
2022-01-14 09:14:11 +01:00
3 changed files with 28 additions and 18 deletions
+7
View File
@@ -12,10 +12,12 @@ import { chatHistory, Rooms } from 'src/app/models/chatMethod';
export class WsChatService {
isLogin = false;
loginResponse = {}
constructor() {}
connect() {
if(this.ws.connected == true) { return false }
this.ws.connect();
@@ -41,6 +43,9 @@ export class WsChatService {
}
login() {
if(this.isLogin == true) { return new Promise((resolve, reject)=>{ resolve(this.loginResponse) }) }
const requestId = uuidv4()
const message = {
@@ -66,7 +71,9 @@ export class WsChatService {
if(message.result.token) {
this.isLogin = true
this.loginResponse = message
console.log('wsMsgQueue', this.wsMsgQueue)
this.ws.wsMsgQueue()
resolve(message)