From 38327aeccc88e2829ffb2ab6b8c7992b202cec9c Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Tue, 26 Nov 2019 16:06:38 +0000 Subject: [PATCH] Fixed gallery persisting through reconnects --- .../viewComponents/galleryDisplay.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/components/viewComponents/galleryDisplay.vue b/src/components/viewComponents/galleryDisplay.vue index fd773fd5..85a02f16 100644 --- a/src/components/viewComponents/galleryDisplay.vue +++ b/src/components/viewComponents/galleryDisplay.vue @@ -241,6 +241,24 @@ export default { }); }, + created: function() { + // Watch for host 'ready', then update status + this.$store.watch( + (state, getters) => { + return getters.ready; + }, + ready => { + if (ready) { + // If the connection is now ready, update capture list + this.updateCaptureList(); + } else { + // If the connection is now disconnected, empty capture list + this.captures = {}; + } + } + ); + }, + methods: { updateCaptureList: function() { console.log("Updating capture list...");