fix(vue-app): check that link.__prefetch exists before calling it (#8608)

closes #8173
This commit is contained in:
Daniel Roe 2021-01-08 18:23:55 +00:00 committed by GitHub
parent 746b14319a
commit 3bba4c6a7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ const cancelIdleCallback = window.cancelIdleCallback || function (id) {
const observer = window.IntersectionObserver && new window.IntersectionObserver((entries) => {
entries.forEach(({ intersectionRatio, target: link }) => {
if (intersectionRatio <= 0) {
if (intersectionRatio <= 0 || !link.__prefetch) {
return
}
link.__prefetch()