Skip to content

Commit c065505

Browse files
committed
fix(nuxt): preload links with same hostname
1 parent 8bdd620 commit c065505

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/nuxt/src/app/plugins/payload.client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export default defineNuxtPlugin({
2323
onNuxtReady(() => {
2424
// Load payload into cache
2525
nuxtApp.hooks.hook('link:prefetch', async (url) => {
26-
const { protocol } = new URL(url, window.location.href)
27-
if (!protocol) {
26+
const { hostname } = new URL(url, window.location.href)
27+
if (hostname === window.location.hostname) {
2828
await loadPayload(url)
2929
}
3030
})

0 commit comments

Comments
 (0)