lbry-desktop/ui/page/notifications/index.js
infinite-persistence 3bab4feeca Update GUI to use queried notification filter.
- 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).
2021-04-08 14:28:21 -04:00

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);