From 90b940f886fa388575cd5a1ade0f2acbf7555b2e Mon Sep 17 00:00:00 2001 From: Ole Date: Wed, 13 Nov 2024 09:30:48 +0100 Subject: [PATCH] fix: Update term on Search page correctly (#14800) --- src/Apps/Search/SearchApp.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Apps/Search/SearchApp.tsx b/src/Apps/Search/SearchApp.tsx index 29af243f0d5..9de7ffebd55 100644 --- a/src/Apps/Search/SearchApp.tsx +++ b/src/Apps/Search/SearchApp.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Box, FullBleed, @@ -8,17 +7,17 @@ import { Text, } from "@artsy/palette" import { SearchApp_viewer$data } from "__generated__/SearchApp_viewer.graphql" +import { AppContainer } from "Apps/Components/AppContainer" import { NavigationTabsFragmentContainer as NavigationTabs } from "Apps/Search/Components/NavigationTabs" import { SearchMeta } from "Apps/Search/Components/SearchMeta" import { RecentlyViewed } from "Components/RecentlyViewed" +import { Sticky } from "Components/Sticky" +import React from "react" import { createFragmentContainer, graphql } from "react-relay" -import { ZeroState } from "./Components/ZeroState" import { useRouter } from "System/Hooks/useRouter" -import { Sticky } from "Components/Sticky" -import { AppContainer } from "Apps/Components/AppContainer" +import { ZeroState } from "./Components/ZeroState" import { Jump } from "Utils/Hooks/useJump" -import { usePrevious } from "@artsy/palette" export interface SearchAppProps { viewer: SearchApp_viewer$data @@ -50,7 +49,7 @@ export const SearchApp: React.FC = ({ viewer, children }) => { const { query } = location const { aggregations } = searchConnection ?? {} - const term = usePrevious(query.term ?? "") + const term = query.term const typeAggregation = aggregations?.find(agg => agg?.slice === "TYPE") ?.counts