Skip to content

Commit

Permalink
fix(document-driven): add empty promise for disabled features (#1356)
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Sep 7, 2022
1 parent 8f7e4d9 commit f006734
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/runtime/plugins/documentDriven.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ export default defineNuxtPlugin((nuxt) => {
}

promises.push(navigationQuery)
} else {
promises.push(() => Promise.resolve(null))
}

/**
Expand Down Expand Up @@ -128,6 +130,8 @@ export default defineNuxtPlugin((nuxt) => {
}

promises.push(globalsQuery)
} else {
promises.push(() => Promise.resolve(null))
}

/**
Expand All @@ -152,6 +156,8 @@ export default defineNuxtPlugin((nuxt) => {
}

promises.push(pageQuery)
} else {
promises.push(() => Promise.resolve(null))
}

/**
Expand Down Expand Up @@ -181,6 +187,8 @@ export default defineNuxtPlugin((nuxt) => {
}

promises.push(surroundQuery)
} else {
promises.push(() => Promise.resolve(null))
}

return await Promise.all(promises.map(promise => promise())).then(async ([
Expand Down

0 comments on commit f006734

Please sign in to comment.