<commit_before>import {
    FETCH_NOTIFICATIONS,
    FETCH_NOTIFICATIONS_COUNT,
    DELETE_NOTIFICATION
} from '../actions/notifications';

const defaultState = {
    message: '',
    count: 0,
    notifications: [],
    apps: []
};


export default (state = defaultState, action) => {
    const nextState = Object.assign({}, state);

    switch (action.type) {
        case FETCH_NOTIFICATIONS_COUNT:
            nextState.message = action.message;
            nextState.count = action.count;
            break;
        case FETCH_NOTIFICATIONS:
            nextState.notifications = action.notifications;
            nextState.apps = action.apps;
            break;
        case DELETE_NOTIFICATION:
            nextState.notifications = state.notifications.filter((n) => {
                return n.id === action.id;
            });
            break;
        default:
            return state;
    }

    return nextState;
}<commit_msg>Fix filtering- of deleted notification<commit_after>import {
    FETCH_NOTIFICATIONS,
    FETCH_NOTIFICATIONS_COUNT,
    DELETE_NOTIFICATION
} from '../actions/notifications';

const defaultState = {
    message: '',
    count: 0,
    notifications: [],
    apps: []
};


export default (state = defaultState, action) => {
    const nextState = Object.assign({}, state);

    switch (action.type) {
        case FETCH_NOTIFICATIONS_COUNT:
            nextState.message = action.message;
            nextState.count = action.count;
            break;
        case FETCH_NOTIFICATIONS:
            nextState.notifications = action.notifications;
            nextState.apps = action.apps;
            break;
        case DELETE_NOTIFICATION:
            nextState.notifications = state.notifications.filter((n) => {
                return n.id !== action.id;
            });
            break;
        default:
            return state;
    }

    return nextState;
}
{'fraction_non_alphanumeric': 0.10141881240147137, 'fraction_numerical': 0.0010509721492380452, 'mean_word_length': 2.0415335463258786, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4888496', 'n_tokens_mistral': 547, 'n_tokens_neox': 528, 'n_words': 106}