refactoring

This commit is contained in:
Čarodej
2021-11-26 07:48:38 +01:00
parent 64e8bccb31
commit 5626a054da
6 changed files with 27 additions and 17 deletions

View File

@@ -236,18 +236,19 @@ const FunctionHelpers = {
totalUploadedSize: uploadedSize
}).then(() => {
uploadedSize = uploadedSize + chunk.size
}).catch((error) => {
}).catch(error => {
// Count attempts
attempts++
// Show Error
if (attempts === 3)
this.$isSomethingWrong()
//if (attempts === 3)
// Break uploading process
if ([500, 422].includes(error.response.status))
if ([500, 422].includes(error.response.status)) {
isNotGeneralError = false
this.$isSomethingWrong()
}
})
} while (isNotGeneralError && attempts !== 0 && attempts !== 3)