Skip to content

Commit f38d3a8

Browse files
fix: prevent default filters from getting overwritten (#1757)
Clear Filters button was not unchecking selected filters because of a reference between settings and defaultSettings. i.e., whenever filters changed, the filter reasons in the defaultFilters object also changed, which is not desirable. Using the spread operator to get selected filters fixes this issue
1 parent 854ff25 commit f38d3a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/renderer/routes/Filters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const FiltersRoute: FC = () => {
2222
const { settings, clearFilters, updateSetting } = useContext(AppContext);
2323

2424
const updateReasonFilter = (reason: Reason, checked: boolean) => {
25-
let reasons: Reason[] = settings.filterReasons;
25+
let reasons: Reason[] = [...settings.filterReasons];
2626

2727
if (checked) {
2828
reasons.push(reason);

0 commit comments

Comments
 (0)