Skip to content

How to update progress bar in async process? #15120

Discussion options

You must be logged in to vote

I solved it myself by adding an additional function for the database update. And the funny thing? I found the answer using the AI program ChatGPT!!!

My code now is as follows:

const updateDatabase = async company => {
  await addDocument('companies', companyIndex, company)
}

const importData = async () => {
  try {
    const data = await readFileAsBinaryString(file.value)
    const workbook = read(data, { type: 'binary' })
    const sheets = workbook.Sheets

    // Process all Excel sheets
    for (const key in sheets) {
      const sheet = sheets[key]
      const rows = utils.sheet_to_json(sheet, { header: 1 })
      const columns = rows[0]
      const data = utils.sheet_to_json(sheet)
…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by eugenevk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant