fix(theme-default): remove duplicate judgments in `preconnect()` (#1903)

pull/1904/head
manchan 1 year ago committed by GitHub
parent 616fe5b636
commit 48c9b11316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -34,12 +34,10 @@ const preconnect = () => {
const rIC = window.requestIdleCallback || setTimeout
rIC(() => {
if (!theme.value.algolia || document.head.querySelector(`#${id}`)) return
const preconnect = document.createElement('link')
preconnect.id = id
preconnect.rel = 'preconnect'
preconnect.href = `https://${theme.value.algolia.appId}-dsn.algolia.net`
preconnect.href = `https://${theme.value.algolia!.appId}-dsn.algolia.net`
preconnect.crossOrigin = ''
document.head.appendChild(preconnect)
})

Loading…
Cancel
Save