Add reload when initStream message is received

This commit is contained in:
G.Ambatte
2025-02-07 21:45:27 +13:00
parent f17fbaff49
commit 4669c5d489
+12
View File
@@ -66,6 +66,18 @@ const Homebrew = createClass({
return {};
},
componentDidMount : function(){
const eventSource = new EventSource('/stream');
eventSource.addEventListener('message', (evt)=>{
const messageData = JSON.parse(evt.data);
if(messageData.eventType == 'initStream'){
window.location.reload();
}
});
},
render : function (){
return (
<Router location={this.props.url}>