mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
refactor: remove unnecessary return await (#2224)
* refactor: remove unnecessary return await * refactor: remove unnecessary async
This commit is contained in:
parent
7a301bed6c
commit
16c12d1e85
@ -76,9 +76,9 @@ export default async ssrContext => {
|
||||
await beforeRender()
|
||||
return _app
|
||||
}
|
||||
const render404Page = async () => {
|
||||
const render404Page = () => {
|
||||
app.context.error({ statusCode: 404, message: '<%= messages.error_404 %>' })
|
||||
return await renderErrorPage()
|
||||
return renderErrorPage()
|
||||
}
|
||||
|
||||
<% if (isDev) { %>const s = isDev && Date.now()<% } %>
|
||||
@ -100,7 +100,7 @@ export default async ssrContext => {
|
||||
}
|
||||
// ...If there is a redirect or an error, stop the process
|
||||
if (ssrContext.redirected) return noopApp()
|
||||
if (ssrContext.nuxt.error) return await renderErrorPage()
|
||||
if (ssrContext.nuxt.error) return renderErrorPage()
|
||||
<% } %>
|
||||
|
||||
/*
|
||||
@ -117,7 +117,7 @@ export default async ssrContext => {
|
||||
await middlewareSeries(midd, app.context)
|
||||
// ...If there is a redirect or an error, stop the process
|
||||
if (ssrContext.redirected) return noopApp()
|
||||
if (ssrContext.nuxt.error) return await renderErrorPage()
|
||||
if (ssrContext.nuxt.error) return renderErrorPage()
|
||||
|
||||
/*
|
||||
** Set layout
|
||||
@ -149,7 +149,7 @@ export default async ssrContext => {
|
||||
await middlewareSeries(midd, app.context)
|
||||
// ...If there is a redirect or an error, stop the process
|
||||
if (ssrContext.redirected) return noopApp()
|
||||
if (ssrContext.nuxt.error) return await renderErrorPage()
|
||||
if (ssrContext.nuxt.error) return renderErrorPage()
|
||||
|
||||
/*
|
||||
** Call .validate()
|
||||
@ -210,7 +210,7 @@ export default async ssrContext => {
|
||||
|
||||
// ...If there is a redirect or an error, stop the process
|
||||
if (ssrContext.redirected) return noopApp()
|
||||
if (ssrContext.nuxt.error) return await renderErrorPage()
|
||||
if (ssrContext.nuxt.error) return renderErrorPage()
|
||||
|
||||
// Call beforeNuxtRender methods & add store state
|
||||
await beforeRender()
|
||||
|
@ -73,8 +73,8 @@ export function flatMapComponents(route, fn) {
|
||||
}))
|
||||
}
|
||||
|
||||
export async function resolveRouteComponents(route) {
|
||||
return await Promise.all(
|
||||
export function resolveRouteComponents(route) {
|
||||
return Promise.all(
|
||||
flatMapComponents(route, async (Component, _, match, key) => {
|
||||
// If component is a function, resolve it
|
||||
if (typeof Component === 'function' && !Component.options) {
|
||||
|
Loading…
Reference in New Issue
Block a user