2022-03-13 20:16:00 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<v-snackbar v-model="updateSnackbar" class="updateBar" :timeout="updateSnackbarTimeout">
|
|
|
|
{{ updateSnackbarText }}
|
|
|
|
|
|
|
|
<template v-slot:action="{ attrs }">
|
2022-03-13 20:18:52 +00:00
|
|
|
<v-btn color="primary" text v-bind="attrs" @click="updateSnackbar = false">Close</v-btn>
|
2022-03-13 20:16:00 +00:00
|
|
|
</template>
|
|
|
|
</v-snackbar>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.updateBar {
|
|
|
|
z-index: 99999999;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
updateSnackbar: false,
|
|
|
|
updateSnackbarText: "An update is available",
|
|
|
|
updateSnackbarTimeout: 5000
|
|
|
|
}
|
|
|
|
},
|
2022-03-18 00:25:59 +00:00
|
|
|
|
2022-03-13 20:16:00 +00:00
|
|
|
async mounted() {
|
|
|
|
const commits = await this.$vuetube.commits;
|
2022-03-18 00:25:59 +00:00
|
|
|
const appVersion = process.env.appVersion;
|
|
|
|
if (appVersion !== commits[0].sha && appVersion !== 'dev-local') {
|
2022-03-13 20:16:00 +00:00
|
|
|
this.updateSnackbar = true;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
2022-03-18 00:25:59 +00:00
|
|
|
</script>
|