1
0
Fork 0
forked from gitea/nas

Fix nested buttons in search popout in web UI (#34871)

This commit is contained in:
Eugen Rochko 2025-06-02 14:21:31 +02:00 committed by GitHub
parent 9c80b16401
commit c77158c8b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 5 deletions

View file

@ -121,10 +121,15 @@ export const clickSearchResult = createAppAsyncThunk(
export const forgetSearchResult = createAppAsyncThunk(
'search/forgetResult',
(q: string, { dispatch, getState }) => {
(
{ q, type }: { q: string; type?: RecentSearchType },
{ dispatch, getState },
) => {
const previous = getState().search.recent;
const me = getState().meta.get('me') as string;
const current = previous.filter((result) => result.q !== q);
const current = previous.filter(
(result) => result.q !== q || result.type !== type,
);
searchHistory.set(me, current);
dispatch(updateSearchHistory(current));