delay connectBroadcast in order to ensure subject
This commit is contained in:
parent
de1179c515
commit
fb74d21d4b
|
@ -29,7 +29,7 @@ class CCPExecutionHistory extends HTMLElement {
|
|||
}
|
||||
|
||||
connectedCallback(){
|
||||
this.connectBroadcast()
|
||||
this.connectBroadcastWithSubject()
|
||||
this.render()
|
||||
this.refreshExecutions()
|
||||
}
|
||||
|
@ -272,6 +272,15 @@ class CCPExecutionHistory extends HTMLElement {
|
|||
})
|
||||
}
|
||||
|
||||
connectBroadcastWithSubject(){
|
||||
var interval = window.setInterval( ()=>{
|
||||
if(this.#boot.subject){
|
||||
window.clearInterval(interval)
|
||||
this.connectBroadcast()
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
connectBroadcast(){
|
||||
this.#socket = new WebSocket(`${this.#broadcasturl}/unified?subject=${this.#boot.subject}`);
|
||||
this.#socket.onmessage = event=>{
|
||||
|
|
Loading…
Reference in New Issue