diff options
author | Emiliano Ciavatta | 2020-10-07 12:58:48 +0000 |
---|---|---|
committer | Emiliano Ciavatta | 2020-10-07 12:58:48 +0000 |
commit | d5f94b76986615b255b77b2a7b7ed336e5ad4838 (patch) | |
tree | c813c55845be273efccf60995f43a77fdee68ac8 /frontend/src/views/Footer.js | |
parent | e905618113309eaba7227ff1328a20f6846e4afd (diff) |
Implement notifications
Diffstat (limited to 'frontend/src/views/Footer.js')
-rw-r--r-- | frontend/src/views/Footer.js | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/frontend/src/views/Footer.js b/frontend/src/views/Footer.js index ad1e4f7..dcf9cf8 100644 --- a/frontend/src/views/Footer.js +++ b/frontend/src/views/Footer.js @@ -13,9 +13,9 @@ import { import {TimeRange, TimeSeries} from "pondjs"; import backend from "../backend"; import ChoiceField from "../components/fields/ChoiceField"; -import dispatcher from "../globals"; import {withRouter} from "react-router-dom"; import log from "../log"; +import dispatcher from "../dispatcher"; class Footer extends Component { @@ -39,15 +39,12 @@ class Footer extends Component { componentDidMount() { const filteredPort = this.filteredPort(); this.setState({filteredPort}); - this.loadStatistics(this.state.metric, filteredPort).then(() => - log.debug("Statistics loaded after mount")); - - dispatcher.register((payload) => { - if (payload.actionType === "connections-update") { - this.setState({ - selection: new TimeRange(payload.from, payload.to), - }); - } + this.loadStatistics(this.state.metric, filteredPort).then(() => log.debug("Statistics loaded after mount")); + + dispatcher.register("connection_updates", payload => { + this.setState({ + selection: new TimeRange(payload.from, payload.to), + }); }); } @@ -109,8 +106,7 @@ class Footer extends Component { clearTimeout(this.selectionTimeout); } this.selectionTimeout = setTimeout(() => { - dispatcher.dispatch({ - actionType: "timeline-update", + dispatcher.dispatch("timeline_updates", { from: timeRange.begin(), to: timeRange.end() }); |