diff --git a/src/app/Scenes/Search/components/AutosuggestSearchResult.tsx b/src/app/Scenes/Search/components/AutosuggestSearchResult.tsx index 7b112e257d3..7ce030b2a89 100644 --- a/src/app/Scenes/Search/components/AutosuggestSearchResult.tsx +++ b/src/app/Scenes/Search/components/AutosuggestSearchResult.tsx @@ -31,6 +31,7 @@ type ArtistTabs = "Insights" | "Artworks" type PassedProps = { initialTab: ArtistTabs + scrollToArtworksGrid?: boolean } type HandleResultPress = (passProps?: PassedProps) => void @@ -199,13 +200,20 @@ function navigateToResult(result: AutosuggestResult, props?: PassedProps) { } else if (result.displayType === "Fair") { navigateToEntity(result.href!, EntityType.Fair, SlugType.ProfileID) } else if (result.__typename === "Artist") { - if (props?.initialTab === "Insights") { - navigate(`${result.href!}/auction-results`, { passProps: props }) + switch (props?.initialTab) { + case "Insights": + navigate(`${result.href!}/auction-results`, { passProps: props }) + break + case "Artworks": + navigate(`${result.href!}/artworks`, { + passProps: props, + }) + break + + default: + navigate(result.href!) + break } - if (props?.initialTab === "Artworks") { - navigate(`${result.href!}/artworks`, { passProps: props }) - } - navigate(result.href!) } else { navigate(result.href!) } diff --git a/src/app/routes.ts b/src/app/routes.ts index 8cda0879e99..59e40f9b75d 100644 --- a/src/app/routes.ts +++ b/src/app/routes.ts @@ -140,7 +140,8 @@ function getDomainMap(): Record { })), addRoute("/artist/:artistID/artworks", "Artist", (params) => ({ ...params, - initialTab: "Insights", + initialTab: "Artworks", + scrollToArtworksGrid: true, })), addRoute("/artist/:artistID/shows", "ArtistShows"),