mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-31 05:31:10 -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 () { | ||||
|     window.axios.get('/api/settings/app/version').then((res) => { | ||||
|       this.currentVersion = res.data.version | ||||
|     }) | ||||
|   }, | ||||
|   methods: { | ||||
|     closeHandler () { | ||||
|       console.log('closing') | ||||
|     }, | ||||
|     async onUpdateApp () { | ||||
|       try { | ||||
|         this.isUpdating = true | ||||
|  | ||||
		Reference in New Issue
	
	Block a user