Support other types of Promises returned by nuxtServerInit()

This commit is contained in:
taldy 2017-03-26 17:54:27 +03:00
parent d63b34de78
commit 93c4be2d28

View File

@ -81,7 +81,7 @@ export default context => {
// nuxtServerInit
<% if (store) { %>
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 { %>
let promise = Promise.resolve()
<% } %>