Skip to content

Commit cfcb3a2

Browse files
Fix preconnect link to target search cluster (#3980)
The `appId` was retrieved from props but the `<Search>` component is never instantiated with props. So the preconnect link targeted an unknown search cluster: ```html <link rel="preconnect" href="https://undefined-dsn.algolia.net" crossorigin="true"> ``` This fixes the preconnect link by getting the `appId` from the website config.
1 parent 011f587 commit cfcb3a2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: src/components/Search.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ const options = {
4646
};
4747
let DocSearchModal: any = null;
4848
export const Search: React.FC<SearchProps> = ({
49-
appId,
5049
searchParameters = {
5150
hitsPerPage: 5,
5251
},
@@ -93,7 +92,7 @@ export const Search: React.FC<SearchProps> = ({
9392
<Head>
9493
<link
9594
rel="preconnect"
96-
href={`https://${appId}-dsn.algolia.net`}
95+
href={`https://${options.appId}-dsn.algolia.net`}
9796
crossOrigin="true"
9897
/>
9998
</Head>

0 commit comments

Comments
 (0)