chore: Reverts reset form in native filters (#15644)

This commit is contained in:
Michael S. Molina 2021-07-13 08:38:32 -03:00 committed by GitHub
parent 52ad779a27
commit f0c0d7492c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -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 ??
@ -208,6 +217,7 @@ export function FiltersConfigModal({
};
const handleConfirmCancel = () => {
resetForm();
onCancel();
};