This commit is contained in:
Peter Maquiran
2022-01-14 09:12:27 +01:00
parent 350358d9c0
commit 96ed821022
+6
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,6 +71,7 @@ export class WsChatService {
if(message.result.token) {
this.isLogin = true
this.loginResponse = message
console.log('wsMsgQueue', this.wsMsgQueue)
this.ws.wsMsgQueue()