Skip to content

Commit

Permalink
chore: Reverts reset form in native filters (#15644)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina committed Jul 13, 2021
1 parent 52ad779 commit f0c0d74
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -164,6 +164,15 @@ export function FiltersConfigModal({
addFilter,
);

// After this, it should be as if the modal was just opened fresh.
// Called when the modal is closed.
const resetForm = () => {
setNewFilterIds([]);
setCurrentFilterId(initialCurrentFilterId);
setRemovedFilters({});
setSaveAlertVisible(false);
};

const getFilterTitle = (id: string) =>
formValues.filters[id]?.name ??
filterConfigMap[id]?.name ??
Expand Down Expand Up @@ -208,6 +217,7 @@ export function FiltersConfigModal({
};

const handleConfirmCancel = () => {
resetForm();
onCancel();
};

Expand Down

0 comments on commit f0c0d74

Please sign in to comment.