Commit e38cacc4 authored by Craig Smith's avatar Craig Smith Committed by Naoyuki Kanezawa

Prevent prefetcher from making identical requests. (#665)

parent b78ab40c
......@@ -121,10 +121,11 @@ export async function prefetch (href) {
messenger.ensureInitialized()
const url = getPrefetchUrl(href)
if (PREFETCHED_URLS[url]) return
if (!PREFETCHED_URLS[url]) {
PREFETCHED_URLS[url] = messenger.send({ action: 'ADD_URL', url: url })
}
await messenger.send({ action: 'ADD_URL', url: url })
PREFETCHED_URLS[url] = true
return PREFETCHED_URLS[url]
}
export async function reloadIfPrefetched (href) {
......
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