Tidied up

This commit is contained in:
Joel Collins 2019-11-22 16:10:01 +00:00
parent 75738c86b1
commit fa01015756

View file

@ -93,7 +93,7 @@ export default {
this.sizeObserver = new ResizeObserver(() => { this.sizeObserver = new ResizeObserver(() => {
this.handleResize(); // For any element attached to the observer, run handleResize() on change this.handleResize(); // For any element attached to the observer, run handleResize() on change
}); });
// Fetch streamDisplay by ref // Fetch streamDisplay component by ref
const streamDisplayElement = this.$refs.streamDisplay.parentNode; const streamDisplayElement = this.$refs.streamDisplay.parentNode;
// Attach streamDisplay to the size observer // Attach streamDisplay to the size observer
this.sizeObserver.observe(streamDisplayElement); this.sizeObserver.observe(streamDisplayElement);
@ -140,6 +140,7 @@ export default {
}, },
flashStream: function() { flashStream: function() {
// Run an animation that flashes the stream (for capture feedback)
let element = this.$refs.streamDisplay; let element = this.$refs.streamDisplay;
element.classList.remove("uk-animation-fade"); element.classList.remove("uk-animation-fade");
element.offsetHeight; /* trigger reflow */ element.offsetHeight; /* trigger reflow */
@ -225,9 +226,7 @@ export default {
// Send preview request // Send preview request
axios axios
.post(requestUri, payload) .post(requestUri, payload)
.then(() => { .then(() => {})
this.$store.dispatch("updateState"); // Update store state
})
.catch(error => { .catch(error => {
this.modalError(error); // Let mixin handle error this.modalError(error); // Let mixin handle error
}); });
@ -235,10 +234,13 @@ export default {
}, },
updateFov: function() { updateFov: function() {
// Get the current field-of-view setting from the server
axios axios
.get(`${this.settingsUri}/fov`) .get(`${this.settingsUri}/fov`)
.then(response => { .then(response => {
this.fov = response.data; if (response.data) {
this.fov = response.data;
}
}) })
.catch(error => { .catch(error => {
this.modalError(error); // Let mixin handle error this.modalError(error); // Let mixin handle error