Unverified Commit f4a01b4b authored by Sebastian Markbåge's avatar Sebastian Markbåge Committed by GitHub

Make prefetch not async (#48897)

The prefetch method is currently an async method but there's nothing to await. It's updated out-of-band. It shouldn't return a Promise.

I also found a console.log that looked out of place.
parent 98e0c4a5
...@@ -235,7 +235,7 @@ function Router({ ...@@ -235,7 +235,7 @@ function Router({
const routerInstance: AppRouterInstance = { const routerInstance: AppRouterInstance = {
back: () => window.history.back(), back: () => window.history.back(),
forward: () => window.history.forward(), forward: () => window.history.forward(),
prefetch: async (href, options) => { prefetch: (href, options) => {
// If prefetch has already been triggered, don't trigger it again. // If prefetch has already been triggered, don't trigger it again.
if (isBot(window.navigator.userAgent)) { if (isBot(window.navigator.userAgent)) {
return return
......
...@@ -30,7 +30,6 @@ export function prefetchReducer( ...@@ -30,7 +30,6 @@ export function prefetchReducer(
* where we didn't have the prefetch intent. We want to update it to the new, more accurate, kind here. * where we didn't have the prefetch intent. We want to update it to the new, more accurate, kind here.
*/ */
if (cacheEntry.kind === PrefetchKind.TEMPORARY) { if (cacheEntry.kind === PrefetchKind.TEMPORARY) {
console.log(href, action.kind, cacheEntry)
state.prefetchCache.set(href, { state.prefetchCache.set(href, {
...cacheEntry, ...cacheEntry,
kind: action.kind, kind: action.kind,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment