mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-29 04:31:08 -04:00
stop window from closing when update in progress
This commit is contained in:
@ -55,13 +55,22 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created () {
|
||||||
|
window.addEventListener('beforeunload', (event) => {
|
||||||
|
if (this.isUpdating) {
|
||||||
|
event.returnValue = 'Update is in progress!'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
window.axios.get('/api/settings/app/version').then((res) => {
|
window.axios.get('/api/settings/app/version').then((res) => {
|
||||||
this.currentVersion = res.data.version
|
this.currentVersion = res.data.version
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
closeHandler () {
|
||||||
|
console.log('closing')
|
||||||
|
},
|
||||||
async onUpdateApp () {
|
async onUpdateApp () {
|
||||||
try {
|
try {
|
||||||
this.isUpdating = true
|
this.isUpdating = true
|
||||||
|
|||||||
Reference in New Issue
Block a user