Moved UI error handling to mixin
This commit is contained in:
parent
55e527c229
commit
12c7298023
10 changed files with 44 additions and 69 deletions
|
|
@ -94,7 +94,6 @@
|
|||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import UIkit from 'uikit'
|
||||
|
||||
// Key Codes
|
||||
const keyCodes = {
|
||||
|
|
@ -207,7 +206,7 @@ export default {
|
|||
this.setPosition = response.data.stage.position; // Update boxes from response
|
||||
})
|
||||
.catch(error => {
|
||||
this.$store.dispatch('handleHTTPError', error); // Let store handle error
|
||||
this.modalError(error) // Let mixin handle error
|
||||
})
|
||||
.then(() => {
|
||||
this.$store.commit('changeMoveLock', false) // Release the move lock
|
||||
|
|
@ -230,8 +229,7 @@ export default {
|
|||
console.log("Successfully finished autofocus")
|
||||
})
|
||||
.catch(error => {
|
||||
UIkit.notification({message: `<span uk-icon=\'icon: warning\'></span> ${error}`, status: 'danger'})
|
||||
this.$store.dispatch('handleHTTPError', error); // Let store handle error
|
||||
this.modalError(error) // Let mixin handle error
|
||||
})
|
||||
.finally(() => {
|
||||
console.log("Cleaning up after autofocus.")
|
||||
|
|
@ -256,8 +254,7 @@ export default {
|
|||
console.log("Successfully finished autofocus")
|
||||
})
|
||||
.catch(error => {
|
||||
UIkit.notification({message: `<span uk-icon=\'icon: warning\'></span> ${error}`, status: 'danger'})
|
||||
this.$store.dispatch('handleHTTPError', error); // Let store handle error
|
||||
this.modalError(error) // Let mixin handle error
|
||||
})
|
||||
.finally(() => {
|
||||
console.log("Cleaning up after autofocus.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue