diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-01-19 10:54:18 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-01-19 10:54:18 +0100 |
commit | 46be4631ae046c45edc3cc8e01c8fc4144ff6444 (patch) | |
tree | c94b389b24384188ede137d7a72a8aaa16b2ec6e /app/assets/javascripts/components/features/ui | |
parent | f051c2e8131616018486cfb9f4a80a120ca71f6e (diff) |
Fix #222 - Update followers count when following/unfollowing
Also, since the root component connects to the stream that updates home/notification columns, there is pretty much no case for refreshing those columns beyond initial load. So, move the loading of those columns into the root component, to prevent unneccessary reloads when switching tabs on mobile or resizing desktop window between mobile/desktop layouts
Diffstat (limited to 'app/assets/javascripts/components/features/ui')
-rw-r--r-- | app/assets/javascripts/components/features/ui/index.jsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/features/ui/index.jsx b/app/assets/javascripts/components/features/ui/index.jsx index ee2e29d6f..003d061ad 100644 --- a/app/assets/javascripts/components/features/ui/index.jsx +++ b/app/assets/javascripts/components/features/ui/index.jsx @@ -8,10 +8,12 @@ import Compose from '../compose'; import TabsBar from './components/tabs_bar'; import ModalContainer from './containers/modal_container'; import Notifications from '../notifications'; +import { connect } from 'react-redux'; +import { isMobile } from '../../is_mobile'; import { debounce } from 'react-decoration'; import { uploadCompose } from '../../actions/compose'; -import { connect } from 'react-redux'; -import { isMobile } from '../../is_mobile' +import { refreshTimeline } from '../../actions/timelines'; +import { refreshNotifications } from '../../actions/notifications'; const UI = React.createClass({ @@ -56,6 +58,9 @@ const UI = React.createClass({ window.addEventListener('resize', this.handleResize, { passive: true }); window.addEventListener('dragover', this.handleDragOver); window.addEventListener('drop', this.handleDrop); + + this.props.dispatch(refreshTimeline('home')); + this.props.dispatch(refreshNotifications()); }, componentWillUnmount () { |