fix js errors

This commit is contained in:
Alex Turchyn
2024-05-30 00:35:35 +03:00
committed by Pete Matsyburka
parent c56f8cb38f
commit 7080e8ea33
4 changed files with 31 additions and 17 deletions
+10 -5
View File
@@ -197,13 +197,18 @@ export default {
download () {
this.isDownloading = true
fetch(this.baseUrl + `/submitters/${this.submitterSlug}/download`).then((response) => response.json()).then((urls) => {
const isSafariIos = /iPhone|iPad|iPod/i.test(navigator.userAgent)
fetch(this.baseUrl + `/submitters/${this.submitterSlug}/download`).then(async (response) => {
if (response.ok) {
const urls = await response.json()
const isSafariIos = /iPhone|iPad|iPod/i.test(navigator.userAgent)
if (isSafariIos && urls.length > 1) {
this.downloadSafariIos(urls)
if (isSafariIos && urls.length > 1) {
this.downloadSafariIos(urls)
} else {
this.downloadUrls(urls)
}
} else {
this.downloadUrls(urls)
alert('Failed to download files')
}
})
},
+8 -6
View File
@@ -972,14 +972,16 @@ export default {
this.$nextTick(() => {
this.recalculateButtonDisabledKey = Math.random()
if (scrollToArea) {
this.scrollIntoField(step[0])
if (!this.isCompleted) {
if (scrollToArea) {
this.scrollIntoField(step[0])
this.$refs.form.querySelector('input[type="date"], input[type="number"], input[type="text"], select')?.focus()
}
this.$refs.form.querySelector('input[type="date"], input[type="number"], input[type="text"], select')?.focus()
}
if (clickUpload && !this.values[this.currentField.uuid] && ['file', 'image'].includes(this.currentField.type)) {
this.$refs.form.querySelector('input[type="file"]')?.click()
if (clickUpload && !this.values[this.currentField.uuid] && ['file', 'image'].includes(this.currentField.type)) {
this.$refs.form.querySelector('input[type="file"]')?.click()
}
}
})
},