Skip to content

Commit

Permalink
EPMRPP-78737 || Unsaved filter replaces (#3589)
Browse files Browse the repository at this point in the history
This fix allows store unsaved filters instead of replacing them
  • Loading branch information
Bam6ycha authored Sep 18, 2023
1 parent f69ee42 commit 4c4f369
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/src/controllers/filter/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ const updateFilterOrders = (filters, filterId, orders) => {

export const launchesFiltersReducer = (state = [], { type, payload, meta: { oldId } = {} }) => {
switch (type) {
case FETCH_USER_FILTERS_SUCCESS:
return payload;
case FETCH_USER_FILTERS_SUCCESS: {
const unsavedFilters = state.filter(({ id }) => id < 0);

return [...payload, ...unsavedFilters];
}
case UPDATE_FILTER_CONDITIONS:
return updateFilterConditions(state, payload.filterId, payload.conditions);
case UPDATE_FILTER_ORDERS:
Expand Down

0 comments on commit 4c4f369

Please sign in to comment.