mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix logout
This commit is contained in:
@@ -78,7 +78,6 @@ export class WsChatService {
|
||||
//
|
||||
if(message.result) {
|
||||
if(message.result.token) {
|
||||
|
||||
this.isLogin = true
|
||||
this.loginResponse = message
|
||||
|
||||
@@ -106,6 +105,7 @@ export class WsChatService {
|
||||
|
||||
getRooms(roomOlder = 1480377601) {
|
||||
|
||||
|
||||
//const requestId = uuidv4()
|
||||
const requestId = uuidv4()
|
||||
const message = {
|
||||
@@ -121,7 +121,6 @@ export class WsChatService {
|
||||
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
|
||||
if(message.id == requestId) { // same request send
|
||||
resolve(message)
|
||||
//
|
||||
return true
|
||||
}
|
||||
}})
|
||||
@@ -186,6 +185,7 @@ export class WsChatService {
|
||||
logout() {
|
||||
this.isLogin = false
|
||||
this.ws.connected = false
|
||||
this.ws.disconnect()
|
||||
}
|
||||
|
||||
// send message to room
|
||||
@@ -749,6 +749,7 @@ export class WsChatService {
|
||||
const data = JSON.parse(event.data)
|
||||
|
||||
//
|
||||
// console.log(data)
|
||||
|
||||
for (const [key, value] of Object.entries(this.wsCallbacks)) {
|
||||
if(value.type== 'Onmessage') {
|
||||
@@ -777,6 +778,15 @@ export class WsChatService {
|
||||
|
||||
onerror: (event: any) => {
|
||||
|
||||
},
|
||||
disconnect:() => {
|
||||
if(this.socket) {
|
||||
this.socket.onopen = (event: any) => {}
|
||||
this.socket.onmessage = (event: any) => {}
|
||||
this.socket.onclose = (event: any) => {}
|
||||
this.socket.onerror = (event: any) => {}
|
||||
this.socket.close()
|
||||
}
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user