Added version mismatch warning

This commit is contained in:
Joel Collins 2019-06-05 17:48:50 +01:00
parent ee91e11853
commit a6a918827c

View file

@ -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