mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
fix(vue-app): don't fetch payload for store mutation for preview and spa fallback (#7723)
This commit is contained in:
parent
e537e8c92a
commit
f81c588bf6
@ -525,10 +525,12 @@ async function render (to, from, next) {
|
|||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<% if (isFullStatic && store) { %>
|
<% if (isFullStatic && store) { %>
|
||||||
// Replay store mutations, catching to avoid error page on SPA fallback
|
if (!this.isPreview && !spaFallback) {
|
||||||
promises.push(this.fetchPayload(to.path).then(payload => {
|
// Replay store mutations, catching to avoid error page on SPA fallback
|
||||||
payload.mutations.forEach(m => { this.$store.commit(m[0], m[1]) })
|
promises.push(this.fetchPayload(to.path).then(payload => {
|
||||||
}).catch(err => null))
|
payload.mutations.forEach(m => { this.$store.commit(m[0], m[1]) })
|
||||||
|
}).catch(err => null))
|
||||||
|
}
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
// Check disabled page loading
|
// Check disabled page loading
|
||||||
|
Loading…
Reference in New Issue
Block a user