mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
Support other types of Promises returned by nuxtServerInit()
This commit is contained in:
parent
d63b34de78
commit
93c4be2d28
@ -81,7 +81,7 @@ export default context => {
|
|||||||
// nuxtServerInit
|
// nuxtServerInit
|
||||||
<% if (store) { %>
|
<% if (store) { %>
|
||||||
let promise = (store._actions && store._actions.nuxtServerInit ? store.dispatch('nuxtServerInit', omit(getContext(context), 'redirect', 'error')) : null)
|
let promise = (store._actions && store._actions.nuxtServerInit ? store.dispatch('nuxtServerInit', omit(getContext(context), 'redirect', 'error')) : null)
|
||||||
if (!(promise instanceof Promise)) promise = Promise.resolve()
|
if (!promise || (!(promise instanceof Promise) && (promise && typeof promise.then !== 'function'))) promise = Promise.resolve()
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
let promise = Promise.resolve()
|
let promise = Promise.resolve()
|
||||||
<% } %>
|
<% } %>
|
||||||
|
Loading…
Reference in New Issue
Block a user