提交 1ae3c2e6 编写于 作者: A Arunoda Susiripala 提交者: GitHub

Ping to on-demand-entries on every page change. (#1384)

This will prevent disposing the page after viewing it.
Otherwise, it'll possible to dispose the page even
we load the page on the client.
上级 0d01f5c8
......@@ -3,6 +3,12 @@
import Router from '../lib/router'
import fetch from 'unfetch'
const originalRouteChangeComplete = Router.onRouteChangeComplete
Router.onRouteChangeComplete = (...args) => {
if (originalRouteChangeComplete) originalRouteChangeComplete(...args)
ping()
}
async function ping () {
try {
const url = `/_next/on-demand-entries-ping?page=${Router.pathname}`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册