diff --git a/src/components/paneConnect.vue b/src/components/paneConnect.vue index e50be8f5..20130840 100644 --- a/src/components/paneConnect.vue +++ b/src/components/paneConnect.vue @@ -122,6 +122,26 @@ export default { this.$store.dispatch('firstConnect') .then (() => { console.log("Connected!") + this.checkServerVersion() + }) + .catch(error => { + this.modalError(error) // Let mixin handle error + }) + }, + + checkServerVersion: function () { + this.$store.dispatch('updateState') + .then (() => { + console.log(this.$store.state.apiState.version) + var serverVersion = this.$store.state.apiState.version + var serverVersionMajor = serverVersion.substring(0, 3) + console.log(serverVersionMajor) + var clientVersion = process.env.PACKAGE_VERSION + var clientVersionMajor = clientVersion.substring(0, 3) + console.log(clientVersionMajor) + if (serverVersionMajor != clientVersionMajor) { + this.modalDialog("Version mismatch", "Client and microscope versions do not match. Consider updating your microscope software. Some functionality may currently be broken.", status='warning') + } }) .catch(error => { this.modalError(error) // Let mixin handle error