Fixed working on malformed JSON response in slow autofocus

This commit is contained in:
Joel Collins 2019-04-14 11:27:03 +01:00
parent 9f2d038aba
commit 46008d8714

View file

@ -94,6 +94,7 @@
<script> <script>
import axios from 'axios' import axios from 'axios'
import UIkit from 'uikit'
// Key Codes // Key Codes
const keyCodes = { const keyCodes = {
@ -221,9 +222,9 @@ export default {
this.isAutofocusing = true this.isAutofocusing = true
axios.post(this.autofocusApiUri, {dz: dz}) axios.post(this.autofocusApiUri, {dz: dz})
.then(response => { .then(response => {
console.log("Autofocus Task ID: " + response.data[0].id) console.log("Autofocus Task ID: " + response.data.id)
// Start the store polling TaskId for success // Start the store polling TaskId for success
return this.$store.dispatch('pollTask', [response.data[0].id, null, null]) return this.$store.dispatch('pollTask', [response.data.id, null, null])
}) })
.then(() => { .then(() => {
console.log("Successfully finished autofocus") console.log("Successfully finished autofocus")