diff --git a/src/components/Dashboard.jsx b/src/components/Dashboard.jsx index a92bcb8..162bd75 100644 --- a/src/components/Dashboard.jsx +++ b/src/components/Dashboard.jsx @@ -123,9 +123,7 @@ class Dashboard extends React.Component { { - this.props.actions.toggleNotifications(); - }} + onToggle={this.props.actions.markNotificationsRead} /> !('isRead' in n && n.isRead)) + if (notificationsToRender.length > 0) { return (
{this.props.notifications.map((notification) => { diff --git a/src/reducers/ui.js b/src/reducers/ui.js index 0a643c3..5fa405f 100644 --- a/src/reducers/ui.js +++ b/src/reducers/ui.js @@ -39,28 +39,16 @@ function toggleInfoPopup(uiState, action) { } } -function toggleNotifications(uiState, action) { - return { - ...uiState, - flags: { - ...uiState.flags, - isNotification: !uiState.flags.isNotification - } - } -} - function ui(uiState = initial.ui, action) { switch (action.type) { case TOGGLE_FETCHING_DOMAIN: - return toggleFetchingDomain(uiState, action); + return toggleFetchingDomain(uiState, action) case TOGGLE_FETCHING_SOURCES: - return toggleFetchingSources(uiState, action); + return toggleFetchingSources(uiState, action) case TOGGLE_INFOPOPUP: - return toggleInfoPopup(uiState, action); - case TOGGLE_NOTIFICATIONS: - return toggleNotifications(uiState, action); + return toggleInfoPopup(uiState, action) default: - return uiState; + return uiState } } diff --git a/src/store/initial.js b/src/store/initial.js index 4d1912a..4c8cdbb 100644 --- a/src/store/initial.js +++ b/src/store/initial.js @@ -142,8 +142,7 @@ const initial = { isFetchingSources: false, isCardstack: true, - isInfopopup: false, - isNotification: true + isInfopopup: false }, tools: { formatter: d3.timeFormat("%d %b, %H:%M"),