Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtimsb committed Nov 14, 2023
1 parent ce29480 commit 64f962d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/astro/src/prefetch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function initHoverStrategy() {
clearTimeout(timeout);
}
timeout = setTimeout(() => {
prefetch(href, { with: 'fetch', ignoreSlowConnection: true });
prefetch(href, { with: 'fetch' });
}, 80) as unknown as number;
}

Expand Down Expand Up @@ -155,7 +155,7 @@ function createViewportIntersectionObserver() {
setTimeout(() => {
observer.unobserve(anchor);
timeouts.delete(anchor);
prefetch(anchor.href, { with: 'link', ignoreSlowConnection: true });
prefetch(anchor.href, { with: 'link' });
}, 300) as unknown as number
);
} else {
Expand Down Expand Up @@ -244,8 +244,8 @@ function elMatchesStrategy(el: EventTarget | null, strategy: string): el is HTML
}

// Fallback to tap strategy if using data saver mode or slow connection
if ((attrValue != null || prefetchAll) && isSlowConnection()) {
return strategy === 'tap';
if (strategy === 'tap' && (attrValue != null || prefetchAll) && isSlowConnection()) {
return true;
}

// If anchor has no dataset but we want to prefetch all, or has dataset but no value,
Expand Down

0 comments on commit 64f962d

Please sign in to comment.