1
0
Fork 0

fix(shared): Nailed it! seen on export failure

This commit is contained in:
Benjamin Fan 2024-02-18 08:49:25 -08:00
parent f516d2deb6
commit 4c15605256
3 changed files with 8 additions and 4 deletions

View file

@ -107,6 +107,7 @@ export const handleExport = async ({
t,
startLoading,
stopLoading,
stopLoadingFail,
onComplete,
onError,
ui,
@ -134,15 +135,16 @@ export const handleExport = async ({
}
// do additional business
onComplete && onComplete(e)
// stop the loader
if (typeof stopLoading === 'function') stopLoading()
}
// on error
else {
console.log(e.data.error)
onError && onError(e)
// stop the loader
if (typeof stopLoadingFail === 'function') stopLoadingFail()
}
// stop the loader
if (typeof stopLoading === 'function') stopLoading()
})
// pdf settings
@ -229,7 +231,6 @@ export const handleExport = async ({
}
} catch (err) {
console.log(err)
if (typeof stopLoading === 'function') stopLoading()
onError && onError(err)
}
}