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-18 00:25:59 +00:00
|
|
|
|
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;
|
2022-06-22 20:54:47 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
2022-03-18 00:25:59 +00:00
|
|
|
</script>
|