0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-10-31 17:02:38 +00:00

update this.$vuetube to use promises & bug fixes

This commit is contained in:
Kenny 2022-03-10 09:59:50 -05:00
parent b801505e75
commit 94a6fb541c
6 changed files with 57 additions and 23 deletions

View file

@ -1,13 +1,34 @@
<template>
<center class="pageTitle">
<h1>VueTube</h1>
<v-btn><v-icon>mdi-github</v-icon></v-btn>
<v-btn><v-icon>mdi-discord</v-icon></v-btn>
<center style="padding: 1em;">
<v-img src="/icon.svg" width="100px" />
<h1 class="pageTitle">VueTube</h1>
<v-btn @click="openExternal('https://github.com/Frontesque/VueTube')"><v-icon>mdi-github</v-icon></v-btn>
<v-btn @click="openExternal('https://discord.gg/7P8KJrdd5W')"><v-icon>mdi-discord</v-icon></v-btn>
<p>App Version: {{ version }}</p>
</center>
</template>
<style scoped>
.pageTitle {
margin-bottom: 2em;
margin-bottom: 1em;
}
</style>
<script>
import { Browser } from '@capacitor/browser';
export default {
data() {
return {
version: process.env.appVersion
}
},
methods: {
async openExternal(url) {
await Browser.open({ url: url });
}
}
}
</script>

View file

@ -51,14 +51,13 @@ export default {
commits: new Array()
}
},
mounted() {
this.$vuetube.commits((commits) => {
if (commits[0].sha) { //If Commit Valid
this.commits = commits;
} else {
console.log(commits)
}
})
async mounted() {
const commits = await this.$vuetube.commits;
if (commits[0].sha) { //If Commit Valid
this.commits = commits;
} else {
console.log(commits)
}
},
methods: {
async openExternal(item) {

View file

@ -4,19 +4,21 @@ import { Http } from '@capacitor-community/http';
const module = {
//--- Get GitHub Commits ---//
commits(callback) {
commits: new Promise((resolve, reject) => {
Http.request({
method: 'GET',
url: "https://api.github.com/repos/Frontesque/VueTube/commits",
params: { }
})
.then((res) => {
callback(res.data)
resolve(res.data)
})
.catch((err) => {
callback(err)
reject(err)
});
}
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB