Skip to content

Commit

Permalink
fix(gatsby-source-contentful): fix progress bar (#31467)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2e1f7e3)
  • Loading branch information
vladar authored and LekoArts committed Jun 2, 2021
1 parent 43dd21b commit 9c131e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/gatsby-source-contentful/src/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ module.exports = async function contentfulFetch({
}) {
// Fetch articles.
let syncProgress
let syncItemCount = 0
const pageLimit = pluginConfig.get(`pageLimit`)
const contentfulClientOptions = {
space: pluginConfig.get(`spaceId`),
Expand Down Expand Up @@ -110,6 +111,8 @@ module.exports = async function contentfulFetch({
!response.isAxiosError &&
response?.data.items
) {
syncItemCount += response.data.items.length
syncProgress.total = syncItemCount
syncProgress.tick(response.data.items.length)
}

Expand Down

0 comments on commit 9c131e7

Please sign in to comment.