fix: check correct layout when navigating from error

Resolves #7567
This commit is contained in:
Sébastien Chopin 2020-06-23 19:54:47 +02:00
parent bc6612b89e
commit 6332aaa3a2

View File

@ -598,7 +598,11 @@ function normalizeComponents (to, ___) {
<% if (features.layouts) { %> <% if (features.layouts) { %>
function setLayoutForNextPage (to) { function setLayoutForNextPage (to) {
// Set layout // Set layout
let layout = this.$options.nuxt.err let hasError = Boolean(this.$options.nuxt.err)
if (this._hadError && this._dateLastError === this.$options.nuxt.dateErr) {
hasError = false
}
let layout = hasError
? (NuxtError.options || NuxtError).layout ? (NuxtError.options || NuxtError).layout
: to.matched[0].components.default.options.layout : to.matched[0].components.default.options.layout