diff --git a/ccp/js/executionhistorycontroller.js b/ccp/js/executionhistorycontroller.js index 7c253ae..330a3c1 100644 --- a/ccp/js/executionhistorycontroller.js +++ b/ccp/js/executionhistorycontroller.js @@ -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=>{