✨ (app) add update app version button in header!
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<span class="queue-notif"></span>
|
||||
<a href="#" class="queue-notif" v-if="newVersion" @click.prevent="reloadApp">
|
||||
nouvelle version dispoible
|
||||
</a>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -9,7 +11,9 @@ import notif from '@/utils/notif'
|
||||
|
||||
@Component
|
||||
export default class QueueNotif extends Vue {
|
||||
public mounted() {
|
||||
private newVersion = queueNotifService.getNewVersion
|
||||
|
||||
private mounted() {
|
||||
queueNotifService.subscribe((notification) => {
|
||||
switch (notification.type) {
|
||||
case 'success':
|
||||
@@ -20,10 +24,17 @@ export default class QueueNotif extends Vue {
|
||||
break
|
||||
}
|
||||
})
|
||||
queueNotifService.subscribeToNewVersion((newVersion: boolean) => {
|
||||
this.newVersion = newVersion
|
||||
})
|
||||
}
|
||||
|
||||
public beforeDestroy() {
|
||||
private beforeDestroy() {
|
||||
queueNotifService.unsubscribe()
|
||||
}
|
||||
|
||||
private reloadApp() {
|
||||
location.reload(true)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user