Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
f3955bd9
Commit
f3955bd9
authored
Jul 02, 2017
by
Arunoda Susiripala
Committed by
GitHub
Jul 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix page auto-reload when there's a 404/500 page. (#2437)
parent
a07c7c44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
on-demand-entries-client.js
client/on-demand-entries-client.js
+6
-1
No files found.
client/on-demand-entries-client.js
View file @
f3955bd9
...
...
@@ -14,7 +14,12 @@ export default () => {
const
res
=
await
fetch
(
url
)
const
payload
=
await
res
.
json
()
if
(
payload
.
invalid
)
{
location
.
reload
()
// Payload can be invalid even if the page is not exists.
// So, we need to make sure it's exists before reloading.
const
pageRes
=
await
fetch
(
location
.
href
)
if
(
pageRes
.
status
===
200
)
{
location
.
reload
()
}
}
}
catch
(
err
)
{
console
.
error
(
`Error with on-demand-entries-ping:
${
err
.
message
}
`
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment