Skip to content

Commit

Permalink
#4837 - Library filter does not reset when switching between Micro an…
Browse files Browse the repository at this point in the history
…d Macro mode (#4859)

* #4837 - Library filter does not reset when switching between Micro and Macro mode

* hotfix: remove unnecessary state
  • Loading branch information
Guch1g0v authored Jun 19, 2024
1 parent 73aadfb commit 5877373
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
import React, { ChangeEvent, useRef } from 'react';
import React, { ChangeEvent, useEffect, useRef } from 'react';
import { Tabs } from 'components/shared/Tabs';
import { tabsContent } from 'components/monomerLibrary/tabsContent';
import { useAppDispatch, useAppSelector, useLayoutMode } from 'hooks';
Expand Down Expand Up @@ -51,6 +51,10 @@ const MonomerLibrary = React.memo((props: MonomerLibraryProps) => {
const isDisabledTabsPanels =
isSequenceMode && !isSequenceEditInRNABuilderMode;

useEffect(() => {
dispatch(setSearchFilter(''));
}, [dispatch]);

useAppSelector(selectAllPresets, (presets) => {
presetsRef.current = presets;
return true;
Expand Down

0 comments on commit 5877373

Please sign in to comment.