Skip to content

Commit 085a6b9

Browse files
committed
feat: remove preconnect link tag since initialization is always deferred
1 parent 0b4a864 commit 085a6b9

2 files changed

Lines changed: 0 additions & 15 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ You can pass the following props to the `LiveChatLoaderProvider` provider:
127127
- `idlePeriod`: How long to wait in ms before loading the provider. Default is
128128
`2000`. Set to `0` to never load. This value is used in a `setTimeout` in
129129
browsers that don't support `requestIdleCallback`.
130-
- `preconnect`: Determines whether a `link` tag with `rel=preconnect` is created. Default is `true`.
131130
- `beforeInit`: A function to be called after the script has loaded, but before the chat provider has been initialized (optional)
132131
- `onReady`: A function to be called once the script has been loaded, the chat provider has been initialized and is ready for use (optional)
133132

src/components/LiveChatLoaderProvider.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ interface LiveChatLoaderProps {
77
provider: Provider
88
children: React.ReactNode
99
idlePeriod?: number
10-
/**
11-
* determines whether to create a link tag that preconnect to the chat provider's domain
12-
*
13-
* @default true
14-
*/
15-
preconnect?: boolean
1610
providerKey: string
1711
appID?: string
1812
baseUrl?: string
@@ -26,7 +20,6 @@ export const LiveChatLoaderProvider = ({
2620
provider,
2721
children,
2822
idlePeriod = 5000,
29-
preconnect = true,
3023
baseUrl,
3124
...props
3225
}: LiveChatLoaderProps): JSX.Element | null => {
@@ -52,13 +45,6 @@ export const LiveChatLoaderProvider = ({
5245

5346
return (
5447
<LiveChatLoaderContext.Provider value={value}>
55-
{preconnect && (
56-
<link
57-
href={baseUrl || chatProvider.domain}
58-
rel="preconnect"
59-
crossOrigin=""
60-
/>
61-
)}
6248
{children}
6349
</LiveChatLoaderContext.Provider>
6450
)

0 commit comments

Comments
 (0)