0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch.git synced 2024-12-22 13:22:58 -05:00
This commit is contained in:
dragongoose 2023-04-11 13:53:03 -04:00
parent 81e93339b3
commit 50954d9583
No known key found for this signature in database
GPG key ID: 50DB99B921579009
3 changed files with 15 additions and 9 deletions

View file

@ -5,7 +5,6 @@ const PrivacyPageView = () => import('../views/PrivacyPageView.vue')
const HomepageView = () => import('../views/HomepageView.vue')
const CategoryView = () => import('../views/CategoryView.vue')
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [

View file

@ -90,12 +90,11 @@ export default {
try {
const res = await fetch(`${this.protocol}${import.meta.env.VITE_BACKEND_DOMAIN}/api/discover`)
const rawData = await res.json()
if (rawData.status === "ok") {
if (rawData.status === 'ok') {
this.data = rawData.data
} else {
this.data = { status: 'error' }
}
} catch (error) {
console.error(error)
this.data = { status: 'error' }
@ -164,7 +163,9 @@ export default {
<div class="p-2">
<div>
<p class="font-bold text-white text-xl sm:text-base md:text-xl">{{ category.displayName }}</p>
<p class="font-bold text-white text-xl sm:text-base md:text-xl">
{{ category.displayName }}
</p>
<p class="text-sm text-white">{{ abbreviate(category.viewers) }} viewers</p>
</div>

View file

@ -45,14 +45,15 @@ export default {
const protocol = import.meta.env.VITE_HTTPS === 'true' ? 'https://' : 'http://'
try {
const res = await fetch(`${protocol}${import.meta.env.VITE_BACKEND_DOMAIN}/api/users/${username}`)
const res = await fetch(
`${protocol}${import.meta.env.VITE_BACKEND_DOMAIN}/api/users/${username}`
)
const rawData = await res.json()
if (rawData.status === "ok") {
if (rawData.status === 'ok') {
this.data = rawData.data
} else {
this.data = { status: 'error' }
}
} catch (error) {
console.error(error)
this.data = { status: 'error' }
@ -75,8 +76,13 @@ export default {
<error-message v-else-if="data.status === 'error'"></error-message>
<div v-else class="w-full justify-center md:inline-flex space-y-4 md:space-y-0 md:space-x-4 md:p-4">
<div class="flex bg-ctp-crust flex-col p-6 rounded-lg w-[99vw] md:max-w-prose md:min-w-[65ch] text-white">
<div
v-else
class="w-full justify-center md:inline-flex space-y-4 md:space-y-0 md:space-x-4 md:p-4"
>
<div
class="flex bg-ctp-crust flex-col p-6 rounded-lg w-[99vw] md:max-w-prose md:min-w-[65ch] text-white"
>
<div v-if="data.isLive" class="w-full mx-auto rounded-lg mb-5">
<video-player :options="videoOptions"> </video-player>
</div>