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

This commit is contained in:
tiago.kayaya
2022-01-13 21:24:58 +01:00
3 changed files with 10 additions and 8 deletions
+2 -2
View File
@@ -42,7 +42,7 @@ export class AuthService {
this.WsChatService.connect();
this.WsChatService.login().then((message) => {
console.log('rocket chat login successfully', message)
this.WsChatService.temporaryStatus('online')
this.WsChatService.setStatus('online')
}).catch((message)=>{
console.log('rocket chat login failed', message)
})
@@ -117,7 +117,7 @@ export class AuthService {
this.WsChatService.connect();
this.WsChatService.login().then((message) => {
console.log('rocket chat login successfully', message)
this.WsChatService.temporaryStatus('online')
this.WsChatService.setStatus('online')
}).catch((message)=>{
console.log('rocket chat login failed', message)
})
+8 -5
View File
@@ -61,12 +61,15 @@ export class WsChatService {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId ) { // same request send
if(message.result.token) {
this.isLogin = true
if(message.result) {
if(message.result.token) {
this.isLogin = true
this.ws.wsMsgQueue()
this.ws.wsMsgQueue()
resolve(message)
resolve(message)
}
} else {
this.isLogin = false
reject(message)
@@ -174,7 +177,7 @@ export class WsChatService {
});
}
temporaryStatus(status: 'online' | 'busy' | 'away' | 'offline') {
setStatus(status: 'online' | 'busy' | 'away' | 'offline') {
const requestId = uuidv4()