0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-22 03:05:15 +00:00
This commit is contained in:
Kenny 2022-06-22 12:19:51 -04:00
parent 46b256e127
commit cff501cd5e
3 changed files with 12 additions and 38 deletions

View file

@ -37,9 +37,9 @@ export default {
},
async mounted() {
const commits = await this.$vuetube.commits;
const releases = await this.$vuetube.releases;
const appVersion = process.env.appVersion;
if (appVersion !== commits[0].sha && appVersion !== "dev-local") {
if (appVersion !== releases[0].sha && appVersion !== "dev-local") {
this.updateSnackbar = true;
}
},

View file

@ -1,6 +1,6 @@
<template>
<div>
<v-list-item v-for="(item, index) in commits" :key="index" class="my-1">
<v-list-item v-for="(item, index) in releases" :key="index" class="my-1">
<v-card
flat
class="card my-2 background"
@ -8,21 +8,16 @@
:style="{ borderRadius: `${roundTweak / 2}rem` }"
>
<v-card-title style="padding: 0 0.25em 0 0.75em">
{{ item.author ? item.author.login : item.commit.author.name }}
{{ item.tag_name }}
<span
class="subtitle background--text"
:class="$vuetify.theme.dark ? 'text--lighten-4' : 'text--darken-4'"
v-text="`• ${item.sha.substring(0, 7)}`"
v-text="`• ${ new Date(item.published_at).toLocaleString() }`"
/>
</v-card-title>
<div style="margin-left: 1em">
<div
class="date background--text"
:class="$vuetify.theme.dark ? 'text--lighten-4' : 'text--darken-4'"
v-text="new Date(item.commit.committer.date).toLocaleString()"
/>
{{ item.commit.message }}
{{ item.body }}
</div>
<v-card-actions>
@ -34,7 +29,7 @@
>{{ lang.latest }}</v-chip
>
<v-chip
v-if="item.sha == installedVersion"
v-if="item == installedVersion"
class="tags"
color="green"
style="border-radius: 0.5rem; border: 2px var(--v-green-base)"
@ -88,19 +83,14 @@ export default {
},
data() {
return {
commits: new Array(),
releases: new Array(),
installedVersion: process.env.appVersion,
lang: {},
};
},
async mounted() {
const commits = await this.$vuetube.commits;
if (commits[0].sha) {
//If Commit Valid
this.commits = commits;
} else {
console.log(commits);
}
this.releases = await this.$vuetube.releases;
this.lang = this.$lang("mods").updates;
},

View file

@ -19,10 +19,10 @@ let backActions;
const module = {
//--- Get GitHub Commits ---//
commits: new Promise((resolve, reject) => {
releases: new Promise((resolve, reject) => {
Http.request({
method: "GET",
url: `${constants.URLS.VT_GITHUB}/commits`,
url: `${constants.URLS.VT_GITHUB}/releases`,
params: {},
})
.then((res) => {
@ -33,22 +33,6 @@ const module = {
});
}),
getRuns(item, callback) {
let url = `${constants.URLS.VT_GITHUB}/commits/${item.sha}/check-runs`;
Http.request({
method: "GET",
url: url,
params: {},
})
.then((res) => {
callback(res.data);
})
.catch((err) => {
callback(err);
});
},
haptics: {
async hapticsImpactHeavy(x) {
await Haptics.impact({ style: ImpactStyle.Heavy, duration: x });