]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/App.js
add command to reload clients
[alttp.git] / resources / js / components / App.js
index b5bd9c9fdfd8388d500d97f5ae8e10b9e594719b..f63298978de960aa1602ba08c99772e4989c9b0f 100644 (file)
@@ -37,6 +37,16 @@ const App = () => {
                };
        }, []);
 
+       useEffect(() => {
+               window.Echo.channel('App.Control')
+                       .listen('PleaseRefresh', () => {
+                               location.reload();
+                       });
+               return () => {
+                       window.Echo.leave('App.Control');
+               };
+       }, []);
+
        return <BrowserRouter>
                <UserContext.Provider value={user}>
                        <Header doLogout={doLogout} />