Update version number in package.json and Welcome.vue
This commit is contained in:
@@ -3,7 +3,37 @@ import MenuProvider from '@/components/Pages/MenuProvider.vue'
|
||||
import Navigation from '@/components/Navigation/Navigation.vue'
|
||||
import { useMenuStore } from '@/stores/menu'
|
||||
import { RouterView } from 'vue-router'
|
||||
import { useDialogStore } from '@/stores/dialog'
|
||||
import { onMounted } from 'vue'
|
||||
import { version } from '../../package.json'
|
||||
const menu = useMenuStore()
|
||||
const dialog = useDialogStore()
|
||||
|
||||
const showDialogUpdate = () => {
|
||||
dialog.type = 'success'
|
||||
dialog.title = 'Update Aplikasi'
|
||||
dialog.content =
|
||||
'Aplikasi telah diperbarui. Silahkan muat ulang aplikasi untuk melihat perubahan.'
|
||||
dialog.confirmText = 'Muat Ulang'
|
||||
dialog.showCancelButton = false
|
||||
dialog.onConfirm = () => {
|
||||
window.location.reload()
|
||||
}
|
||||
dialog.dismissOnAction = false
|
||||
dialog.open = true
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const localVersion = localStorage.getItem('version')
|
||||
if (localVersion) {
|
||||
if (localVersion !== version) {
|
||||
localStorage.setItem('version', version)
|
||||
showDialogUpdate()
|
||||
}
|
||||
} else {
|
||||
localStorage.setItem('version', version)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
Reference in New Issue
Block a user