Skip to content

Commit

Permalink
fix: [M3-7002] fix circular dep
Browse files Browse the repository at this point in the history
  • Loading branch information
abailly-akamai committed Aug 11, 2023
1 parent af161f3 commit d550566
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/manager/src/features/Search/SearchLanding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,6 @@ export const SearchLanding: React.FC<CombinedProps> = (props) => {
(linodes ?? []).map((linode) => linode.type).filter(isNotNullOrUndefined)
);
const types = extendTypesQueryResult(typesQuery);

const searchableLinodes = (linodes ?? []).map((linode) => {
const imageLabel = getImageLabelForLinode(linode, publicImages ?? []);
return formatLinode(linode, types, imageLabel);
});

const [apiResults, setAPIResults] = React.useState<any>({});
const [apiError, setAPIError] = React.useState<null | string>(null);
const [apiSearchLoading, setAPILoading] = React.useState<boolean>(false);
Expand Down Expand Up @@ -206,6 +200,11 @@ export const SearchLanding: React.FC<CombinedProps> = (props) => {
if (isLargeAccount) {
_searchAPI(query);
} else {
const searchableLinodes = (linodes ?? []).map((linode) => {
const imageLabel = getImageLabelForLinode(linode, publicImages ?? []);
return formatLinode(linode, types, imageLabel);
});

search(
query,
objectStorageBuckets?.buckets ?? [],
Expand All @@ -231,7 +230,7 @@ export const SearchLanding: React.FC<CombinedProps> = (props) => {
_privateImages,
regions,
nodebalancers,
searchableLinodes,
linodes,
]);

const getErrorMessage = () => {
Expand Down

0 comments on commit d550566

Please sign in to comment.