Make streaming API use one pattern-matching redis pubsub connection

Refresh timelines when streaming API reconnects in the UI
This commit is contained in:
Eugen Rochko
2017-02-07 14:37:12 +01:00
parent 9d5fb49cd8
commit 02e91a96dd
3 changed files with 74 additions and 36 deletions

View File

@ -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());
}
});