diff --git a/src/components/viewComponents/galleryComponents/zipDownloader.vue b/src/components/viewComponents/galleryComponents/zipDownloader.vue index f9242565..c3eb4fbc 100644 --- a/src/components/viewComponents/galleryComponents/zipDownloader.vue +++ b/src/components/viewComponents/galleryComponents/zipDownloader.vue @@ -63,6 +63,10 @@ export default { } }, + mounted: function() { + this.updateZipperUri(); + }, + created: function() { // Watch for host 'ready', then update status this.unwatchStoreFunction = this.$store.watch( @@ -80,23 +84,28 @@ export default { methods: { updateZipperUri: function() { - axios - .get(this.pluginsUri) // Get a list of plugins - .then(response => { - var plugins = response.data; - var foundExtension = plugins.find( - e => e.title === "org.openflexure.zipbuilder" - ); - // if ZipBuilderPlugin is enabled - if (foundExtension) { - // Get plugin action links - this.zipBuilderUri = foundExtension.links.build.href; - this.zipGetterUri = foundExtension.links.get.href; - } - }) - .catch(error => { - this.modalError(error); // Let mixin handle error - }); + if (this.$store.state.available) { + axios + .get(this.pluginsUri) // Get a list of plugins + .then(response => { + var plugins = response.data; + var foundExtension = plugins.find( + e => e.title === "org.openflexure.zipbuilder" + ); + // if ZipBuilderPlugin is enabled + if (foundExtension) { + // Get plugin action links + this.zipBuilderUri = foundExtension.links.build.href; + this.zipGetterUri = foundExtension.links.get.href; + } + }) + .catch(error => { + this.modalError(error); // Let mixin handle error + }); + } else { + this.zipBuilderUri = null; + this.zipGetterUri = null; + } }, resetZipper: function() { diff --git a/src/components/viewComponents/galleryDisplay.vue b/src/components/viewComponents/galleryDisplay.vue index 8c331530..14f0b0c1 100644 --- a/src/components/viewComponents/galleryDisplay.vue +++ b/src/components/viewComponents/galleryDisplay.vue @@ -9,14 +9,14 @@ > @@ -80,12 +80,17 @@ v-if="galleryFolder" class="uk-flex uk-flex-middle uk-padding uk-padding-remove-horizontal uk-padding-remove-bottom" > - arrow_back + arrow_back +

- SCAN {{ allScans[galleryFolder].metadata.image.name }} + SCAN + {{ allScans[galleryFolder].metadata.image.name }}

@@ -267,6 +272,8 @@ export default { }, mounted() { + // Update on mount (does nothing if not connected) + this.updateCaptures(); // A global signal listener to perform a gallery refresh this.$root.$on("globalUpdateCaptures", () => { this.updateCaptures(); @@ -309,15 +316,19 @@ export default { methods: { updateCaptures: function() { - console.log("Updating capture list..."); - axios - .get(this.capturesUri) - .then(response => { - this.captures = response.data; - }) - .catch(error => { - this.modalError(error); // Let mixin handle error - }); + if (this.$store.state.available) { + console.log("Updating capture list..."); + axios + .get(this.capturesUri) + .then(response => { + this.captures = response.data; + }) + .catch(error => { + this.modalError(error); // Let mixin handle error + }); + } else { + console.log("Delaying capture update until connection is available"); + } }, filterCaptures: function(list, filterTags) {