Add "clear notifications" button, exclude posts from people who have blocked *you* from public/hashtag timelines

This commit is contained in:
Eugen Rochko
2017-02-07 00:06:40 +01:00
parent c8252759df
commit ac035108aa
6 changed files with 54 additions and 3 deletions

View File

@ -14,6 +14,8 @@ export const NOTIFICATIONS_EXPAND_REQUEST = 'NOTIFICATIONS_EXPAND_REQUEST';
export const NOTIFICATIONS_EXPAND_SUCCESS = 'NOTIFICATIONS_EXPAND_SUCCESS';
export const NOTIFICATIONS_EXPAND_FAIL = 'NOTIFICATIONS_EXPAND_FAIL';
export const NOTIFICATIONS_CLEAR = 'NOTIFICATIONS_CLEAR';
const fetchRelatedRelationships = (dispatch, notifications) => {
const accountIds = notifications.filter(item => item.type === 'follow').map(item => item.account.id);
@ -139,3 +141,13 @@ export function expandNotificationsFail(error) {
error
};
};
export function clearNotifications() {
return (dispatch, getState) => {
dispatch({
type: NOTIFICATIONS_CLEAR
});
api(getState).post('/api/v1/notifications/clear');
};
};