Merge branch 'master' of github.com:budibase/budibase into test-oracle
This commit is contained in:
commit
d6c5042aa6
|
@ -100,25 +100,33 @@
|
|||
async function handleFile(e) {
|
||||
loading = true
|
||||
error = null
|
||||
const previousValidation = validation
|
||||
validation = {}
|
||||
|
||||
try {
|
||||
const response = await parseFile(e)
|
||||
rows = response.rows
|
||||
fileName = response.fileName
|
||||
|
||||
const newValidateHash = JSON.stringify(rows)
|
||||
if (newValidateHash === validateHash) {
|
||||
validation = previousValidation
|
||||
} else {
|
||||
await validate(rows)
|
||||
validateHash = newValidateHash
|
||||
}
|
||||
} catch (e) {
|
||||
error = e.message || e
|
||||
} finally {
|
||||
loading = false
|
||||
error = e
|
||||
}
|
||||
}
|
||||
|
||||
async function validate(rows) {
|
||||
loading = true
|
||||
error = null
|
||||
validation = {}
|
||||
allValid = false
|
||||
|
||||
try {
|
||||
if (rows.length > 0) {
|
||||
const response = await API.validateExistingTableImport({
|
||||
rows,
|
||||
|
@ -129,22 +137,6 @@
|
|||
invalidColumns = response.invalidColumns
|
||||
allValid = response.allValid
|
||||
}
|
||||
} catch (e) {
|
||||
error = e.message
|
||||
}
|
||||
|
||||
loading = false
|
||||
}
|
||||
|
||||
$: {
|
||||
// binding in consumer is causing double renders here
|
||||
const newValidateHash = JSON.stringify(rows)
|
||||
|
||||
if (newValidateHash !== validateHash) {
|
||||
validate(rows)
|
||||
}
|
||||
|
||||
validateHash = newValidateHash
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue