From 2abf4a4c8c33d1076ab379e13fbf24908bfcd8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 22 Aug 2024 16:59:21 +0200 Subject: [PATCH] Always persist search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/features/compose/components/search.tsx | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/features/compose/components/search.tsx b/src/features/compose/components/search.tsx index fbbc00047..14dcf49a0 100644 --- a/src/features/compose/components/search.tsx +++ b/src/features/compose/components/search.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx'; import debounce from 'lodash/debounce'; -import React, { useCallback, useEffect } from 'react'; +import React, { useCallback } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { useHistory } from 'react-router-dom'; @@ -135,16 +135,6 @@ const Search = (props: ISearch) => { componentProps.autoSelect = false; } - useEffect(() => () => { - const newPath = history.location.pathname; - const shouldPersistSearch = !!newPath.match(/@.+\/posts\/[a-zA-Z0-9]+/g) - || !!newPath.match(/\/tags\/.+/g); - - if (!shouldPersistSearch) { - dispatch(changeSearch('')); - } - }, []); - return (