mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
improve
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user