Skip to content

Commit

Permalink
fix(events): reset event template search filter when switching targets (
Browse files Browse the repository at this point in the history
#273)

* Fix event template search broken when switching targets

* Simplify setting filter text

Co-authored-by: Andrew Azores <aazores@redhat.com>
  • Loading branch information
Hareet Dhillon and andrewazores authored Sep 7, 2021
1 parent 6663e11 commit eca4cb6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/Events/EventTemplates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ export const EventTemplates = () => {

React.useEffect(() => {
addSubscription(
context.target.target().subscribe(refreshTemplates)
);
context.target.target().subscribe(() => {
setFilterText('');
refreshTemplates();
}));
}, [context, context.target, addSubscription, refreshTemplates]);

React.useEffect(() => {
Expand Down

0 comments on commit eca4cb6

Please sign in to comment.