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) { %>
|
||||
// Replay store mutations, catching to avoid error page on SPA fallback
|
||||
promises.push(this.fetchPayload(to.path).then(payload => {
|
||||
payload.mutations.forEach(m => { this.$store.commit(m[0], m[1]) })
|
||||
}).catch(err => null))
|
||||
if (!this.isPreview && !spaFallback) {
|
||||
// Replay store mutations, catching to avoid error page on SPA fallback
|
||||
promises.push(this.fetchPayload(to.path).then(payload => {
|
||||
payload.mutations.forEach(m => { this.$store.commit(m[0], m[1]) })
|
||||
}).catch(err => null))
|
||||
}
|
||||
<% } %>
|
||||
|
||||
// Check disabled page loading
|
||||
|
Loading…
Reference in New Issue
Block a user