3bab4feeca
- Re-organize the return statement of 'NotificationsPage' a bit, otherwise the entire page will reload (blink) every time the drop-down value is changed due to the 'fetching' flag. - Retained the original behavior of (only showing a blank page + spinner) on the very first load. I think there is merit in not showing the buttons immediately (e.g. when not logged in and `/$/notifications` is accessed directly).
24 lines
814 B
JavaScript
24 lines
814 B
JavaScript
import { connect } from 'react-redux';
|
|
import {
|
|
selectNotifications,
|
|
selectNotificationsFiltered,
|
|
selectIsFetchingNotifications,
|
|
selectUnreadNotificationCount,
|
|
selectUnseenNotificationCount,
|
|
} from 'redux/selectors/notifications';
|
|
import { doReadNotifications, doNotificationList, doSeeAllNotifications } from 'redux/actions/notifications';
|
|
import NotificationsPage from './view';
|
|
|
|
const select = (state) => ({
|
|
notifications: selectNotifications(state),
|
|
notificationsFiltered: selectNotificationsFiltered(state),
|
|
fetching: selectIsFetchingNotifications(state),
|
|
unreadCount: selectUnreadNotificationCount(state),
|
|
unseenCount: selectUnseenNotificationCount(state),
|
|
});
|
|
|
|
export default connect(select, {
|
|
doReadNotifications,
|
|
doNotificationList,
|
|
doSeeAllNotifications,
|
|
})(NotificationsPage);
|