From 02e91a96ddded6f6d2505f80b45705fcfb77ed74 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 7 Feb 2017 14:37:12 +0100 Subject: Make streaming API use one pattern-matching redis pubsub connection Refresh timelines when streaming API reconnects in the UI --- app/assets/javascripts/components/containers/mastodon.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/assets/javascripts/components/containers') diff --git a/app/assets/javascripts/components/containers/mastodon.jsx b/app/assets/javascripts/components/containers/mastodon.jsx index 3b36ce3ef..e23c65121 100644 --- a/app/assets/javascripts/components/containers/mastodon.jsx +++ b/app/assets/javascripts/components/containers/mastodon.jsx @@ -6,7 +6,7 @@ import { deleteFromTimelines, refreshTimeline } from '../actions/timelines'; -import { updateNotifications } from '../actions/notifications'; +import { updateNotifications, refreshNotifications } from '../actions/notifications'; import createBrowserHistory from 'history/lib/createBrowserHistory'; import { applyRouterMiddleware, @@ -80,6 +80,11 @@ const Mastodon = React.createClass({ store.dispatch(updateNotifications(JSON.parse(data.payload), getMessagesForLocale(locale), locale)); break; } + }, + + reconnected () { + store.dispatch(refreshTimeline('home')); + store.dispatch(refreshNotifications()); } }); -- cgit