chore: rename Importer.isValid to Importer.canSubmit

We are not really checking the validity of the form.
This commit is contained in:
Yohan Boniface 2024-12-05 18:03:30 +01:00
parent 1f13c6ef00
commit b692cb0cd1

View file

@ -203,7 +203,7 @@ export default class Importer extends Utils.WithTemplate {
) )
this.qs('[name=layer-name]').toggleAttribute('hidden', Boolean(this.layerId)) this.qs('[name=layer-name]').toggleAttribute('hidden', Boolean(this.layerId))
this.qs('#clear').toggleAttribute('hidden', !this.layerId) this.qs('#clear').toggleAttribute('hidden', !this.layerId)
this.qs('[name=submit').toggleAttribute('disabled', !this.isValid()) this.qs('[name=submit').toggleAttribute('disabled', !this.canSubmit())
} }
onFileChange(e) { onFileChange(e) {
@ -258,7 +258,7 @@ export default class Importer extends Utils.WithTemplate {
this.qs('[type=file]').showPicker() this.qs('[type=file]').showPicker()
} }
isValid() { canSubmit() {
if (!this.format) return false if (!this.format) return false
const hasFiles = Boolean(this.files.length) const hasFiles = Boolean(this.files.length)
const hasRaw = Boolean(this.raw) const hasRaw = Boolean(this.raw)