Fix first loading of notifications when the column is pinned (#4114)

signup-info-prompt
unarist 2017-07-09 00:22:24 +09:00 committed by Eugen Rochko
parent 76318f8830
commit 46f5d3a2e9
2 changed files with 4 additions and 8 deletions

View File

@ -11,10 +11,8 @@ import { isMobile } from '../../is_mobile';
import { debounce } from 'lodash'; import { debounce } from 'lodash';
import { uploadCompose } from '../../actions/compose'; import { uploadCompose } from '../../actions/compose';
import { refreshHomeTimeline } from '../../actions/timelines'; import { refreshHomeTimeline } from '../../actions/timelines';
import { refreshNotifications } from '../../actions/notifications';
import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers'; import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers';
import UploadArea from './components/upload_area'; import UploadArea from './components/upload_area';
import { store } from '../../containers/mastodon';
import ColumnsAreaContainer from './containers/columns_area_container'; import ColumnsAreaContainer from './containers/columns_area_container';
import { import {
Compose, Compose,
@ -30,7 +28,7 @@ import {
Reblogs, Reblogs,
Favourites, Favourites,
HashtagTimeline, HashtagTimeline,
Notifications as AsyncNotifications, Notifications,
FollowRequests, FollowRequests,
GenericNotFound, GenericNotFound,
FavouritedStatuses, FavouritedStatuses,
@ -38,11 +36,6 @@ import {
Mutes, Mutes,
} from './util/async-components'; } from './util/async-components';
const Notifications = () => AsyncNotifications().then(component => {
store.dispatch(refreshNotifications());
return component;
});
// Dummy import, to make sure that <Status /> ends up in the application bundle. // Dummy import, to make sure that <Status /> ends up in the application bundle.
// Without this it ends up in ~8 very commonly used bundles. // Without this it ends up in ~8 very commonly used bundles.
import '../../components/status'; import '../../components/status';

View File

@ -1,4 +1,5 @@
import { store } from '../../../containers/mastodon'; import { store } from '../../../containers/mastodon';
import { refreshNotifications } from '../../../actions/notifications';
import { injectAsyncReducer } from '../../../store/configureStore'; import { injectAsyncReducer } from '../../../store/configureStore';
// NOTE: When lazy-loading reducers, make sure to add them // NOTE: When lazy-loading reducers, make sure to add them
@ -30,6 +31,8 @@ export function Notifications () {
]).then(([component, notificationsReducer]) => { ]).then(([component, notificationsReducer]) => {
injectAsyncReducer(store, 'notifications', notificationsReducer.default); injectAsyncReducer(store, 'notifications', notificationsReducer.default);
store.dispatch(refreshNotifications());
return component; return component;
}); });
} }