(app) add update app version button in header!

This commit is contained in:
Julien Calixte
2020-04-11 14:52:18 +02:00
parent fd2c046c2c
commit f74820e928
5 changed files with 47 additions and 46 deletions

View File

@@ -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>