Added version mismatch warning
This commit is contained in:
parent
ee91e11853
commit
a6a918827c
1 changed files with 20 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue