This commit is contained in:
Peter Maquiran
2023-01-12 15:27:09 +01:00
parent 58f9e7eacd
commit 9493179efd
82 changed files with 702 additions and 557 deletions
+19 -14
View File
@@ -100,6 +100,8 @@ export class AuthService {
session.BasicAuthKey = user.BasicAuthKey
SessionStore.reset(session)
console.log(session)
return true;
}
@@ -109,23 +111,26 @@ export class AuthService {
loginToChatWs() {
setTimeout(() => {
this.RochetChatConnectorService.connect();
this.RochetChatConnectorService.login().then((message: any) => {
SessionStore.user.RochetChatUserId = message.result.id
SessionStore.save()
if(SessionStore.user.ChatData?.data) {
this.RochetChatConnectorService.connect();
this.RochetChatConnectorService.login().then((message: any) => {
SessionStore.user.RochetChatUserId = message.result.id
SessionStore.save()
this.RochetChatConnectorService.setStatus('online')
window['RochetChatConnectorService'] = this.RochetChatConnectorService
setTimeout(() => {
this.ChatSystemService.getAllRooms();
this.RochetChatConnectorService.setStatus('online')
}, 200);
window['RochetChatConnectorService'] = this.RochetChatConnectorService
setTimeout(() => {
this.ChatSystemService.getAllRooms();
this.RochetChatConnectorService.setStatus('online')
}, 200);
}).catch((error) => {
console.error(error)
})
}).catch((error) => {
console.error(SessionStore.user.ChatData, 'web socket login',error)
})
}
// before sending a message with a attachment