Skip to content

Commit

Permalink
Merge pull request #704 from Chia-Network/fix-search-field-not-cleare…
Browse files Browse the repository at this point in the history
…d-when-switching-from-warehouse-to-registry

fix: search field not cleared when switching from warehouse to registry
  • Loading branch information
MichaelTaylor3D committed May 5, 2022
2 parents 7b9242e + 3700daf commit f6fc5b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pages/Projects/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ const Projects = () => {
};
}, []);

useEffect(() => {
setSearchQuery(null);
}, [searchParams.get('myRegistry')]);

useEffect(() => {
const options = {
type: 'projects',
Expand Down Expand Up @@ -324,6 +328,7 @@ const Projects = () => {
<StyledHeaderContainer>
<StyledSearchContainer>
<SearchInput
key={pageIsMyRegistryPage.toString()}
size="large"
onChange={onSearch}
disabled={tabValue !== 0}
Expand Down
5 changes: 5 additions & 0 deletions src/pages/Units/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ const Units = () => {
};
}, []);

useEffect(() => {
setSearchQuery(null);
}, [searchParams.get('myRegistry')]);

useEffect(() => {
const options = {
type: 'units',
Expand Down Expand Up @@ -324,6 +328,7 @@ const Units = () => {
<StyledHeaderContainer>
<StyledSearchContainer>
<SearchInput
key={pageIsMyRegistryPage.toString()}
size="large"
onChange={onSearch}
disabled={tabValue !== 0}
Expand Down

0 comments on commit f6fc5b4

Please sign in to comment.