mirror of https://github.com/status-im/fathom.git
use realtime poll to catch expired/invalid login sessions
This commit is contained in:
parent
b8ceff621d
commit
5fe5b97e94
|
@ -27,6 +27,11 @@ class Realtime extends Component {
|
|||
fetchData() {
|
||||
Client.request(`stats/site/realtime`)
|
||||
.then((d) => { this.setState({ count: d })})
|
||||
.catch((e) => {
|
||||
if(e.message === "Unauthorized") {
|
||||
this.props.onError();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
render(props, state) {
|
||||
|
|
|
@ -34,7 +34,7 @@ class Dashboard extends Component {
|
|||
<nav class="main-nav animated fadeInDown">
|
||||
<ul>
|
||||
<li class="logo"><a href="/">Fathom</a></li>
|
||||
<li class="visitors"><Realtime /></li>
|
||||
<li class="visitors"><Realtime onError={this.props.onLogout} /></li>
|
||||
<li class="spacer">·</li>
|
||||
<li class="signout"><LogoutButton onSuccess={this.props.onLogout} /></li>
|
||||
</ul>
|
||||
|
|
Loading…
Reference in New Issue