0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-08 20:45:07 +00:00
VueTube/NUXT/components/updateChecker.vue

49 lines
985 B
Vue
Raw Normal View History

2022-03-13 20:16:00 +00:00
<template>
2022-03-21 23:47:11 +00:00
<div>
<v-snackbar
v-model="updateSnackbar"
class="updateBar"
:timeout="updateSnackbarTimeout"
>
{{ updateSnackbarText }}
2022-03-13 20:16:00 +00:00
2022-03-21 23:47:11 +00:00
<template #action="{ attrs }">
<v-btn
color="primary"
text
v-bind="attrs"
@click="updateSnackbar = false"
>Close</v-btn
>
</template>
</v-snackbar>
</div>
2022-03-13 20:16:00 +00:00
</template>
<style scoped>
.updateBar {
2022-03-21 23:47:11 +00:00
z-index: 99999999;
2022-03-13 20:16:00 +00:00
}
</style>
<script>
export default {
2022-03-21 23:47:11 +00:00
data() {
return {
updateSnackbar: false,
updateSnackbarText: "An update is available",
updateSnackbarTimeout: 5000,
};
},
2022-03-21 23:47:11 +00:00
async mounted() {
2022-06-22 16:19:51 +00:00
const releases = await this.$vuetube.releases;
2022-03-21 23:47:11 +00:00
const appVersion = process.env.appVersion;
const appChannel = process.env.release;
if (appVersion !== releases[0].tag_name && appVersion !== "dev-local" && appChannel !== "Unstable") {
2022-03-21 23:47:11 +00:00
this.updateSnackbar = true;
}
},
};
</script>