add http interceptor

This commit is contained in:
Peter Maquiran
2023-07-11 17:54:08 +01:00
parent 12178d6c3a
commit 9b690c3848
7 changed files with 118 additions and 38 deletions
@@ -5,6 +5,7 @@ import { deepFind } from 'src/plugin/deep'
import { environment } from 'src/environments/environment';
import { SessionStore } from 'src/app/store/session.service';
import { chatHistory, Rooms } from 'src/app/models/chatMethod';
import { BackgroundService } from '../background.service';
@Injectable({
providedIn: 'root'
@@ -14,7 +15,7 @@ export class RochetChatConnectorService {
isLogin = false;
loginResponse = {}
constructor() {
constructor(private backgroundservice: BackgroundService,) {
}
connect() {
@@ -752,6 +753,7 @@ export class RochetChatConnectorService {
},
onopen: async ()=> {
this.ws.connected = true
this.backgroundservice.online();
setTimeout(()=>{
this.ws.wsMsgQueue()
@@ -804,6 +806,9 @@ export class RochetChatConnectorService {
},
onmessage: async (event: any)=> {
this.backgroundservice.online();
const data = JSON.parse(event.data)
for (const [key, value] of Object.entries(this.wsCallbacks)) {