Format all files to spec
This commit is contained in:
@@ -108,7 +108,6 @@ export async function followersStreaming(streamers: string[], cursor: number): P
|
||||
|
||||
const payloadData = streamers.slice(cursor * 35, cursor * 35 + 35)
|
||||
|
||||
|
||||
const payload = {
|
||||
streamers: payloadData
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ export const setLanguage = (selectedLanguage: string, i18n: any) => {
|
||||
const locale = locales[languages.indexOf(selectedLanguage)]
|
||||
|
||||
if (!locale) {
|
||||
throw Error("Error while setting locale, " + selectedLanguage + " does not exist.")
|
||||
throw Error('Error while setting locale, ' + selectedLanguage + ' does not exist.')
|
||||
}
|
||||
localStorage.setItem('language', locale)
|
||||
i18n.locale = locale
|
||||
|
||||
@@ -59,7 +59,7 @@ export default {
|
||||
const lastStreamCursor = this.data.streams[this.data.streams.length - 1]?.cursor ?? null
|
||||
const newLastStreamCursor = resData.streams[resData.streams.length - 1]?.cursor ?? null
|
||||
if (lastStreamCursor === newLastStreamCursor) {
|
||||
this.endOfScroll = true;
|
||||
this.endOfScroll = true
|
||||
} else {
|
||||
for (const stream of resData.streams) {
|
||||
this.data.streams.push(stream)
|
||||
|
||||
@@ -66,7 +66,10 @@ export default {
|
||||
<template>
|
||||
<loading-screen v-if="!data && status != 'error'"></loading-screen>
|
||||
<error-message v-else-if="status == 'error'"></error-message>
|
||||
<div v-else-if="data" class="md:max-w-[50rem] w-full mx-auto text-contrast flex flex-col justify-center">
|
||||
<div
|
||||
v-else-if="data"
|
||||
class="md:max-w-[50rem] w-full mx-auto text-contrast flex flex-col justify-center"
|
||||
>
|
||||
<vue-title title="Following"></vue-title>
|
||||
<div v-if="data.length == 0" class="text-center">
|
||||
<h1 class="text-3xl font-bold">{{ $t('following.empty') }}</h1>
|
||||
@@ -80,7 +83,10 @@ export default {
|
||||
|
||||
<ul class="m-2 flex flex-wrap justify-center">
|
||||
<li v-for="streamer in data" :key="streamer.login" class="">
|
||||
<div v-if="streamer.username != String()" class="inline-flex bg-overlay0 p-2.5 m-1 rounded-md w-[22rem]">
|
||||
<div
|
||||
v-if="streamer.username != String()"
|
||||
class="inline-flex bg-overlay0 p-2.5 m-1 rounded-md w-[22rem]"
|
||||
>
|
||||
<img :src="streamer.pfp" class="w-16 h-16 rounded-full" />
|
||||
<div class="justify-between flex flex-col ml-2 truncate text-ellipsis w-[8rem]">
|
||||
<h1 class="text-2xl font-bold">
|
||||
@@ -93,7 +99,10 @@ export default {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else="streamer.username != String()" class="inline-flex bg-overlay0 p-2.5 m-1 rounded-md w-[22rem]">
|
||||
<div
|
||||
v-else="streamer.username != String()"
|
||||
class="inline-flex bg-overlay0 p-2.5 m-1 rounded-md w-[22rem]"
|
||||
>
|
||||
<img class="w-16 h-16 rounded-full border-solid border-4 border-red" />
|
||||
<div class="justify-between flex flex-col ml-2 truncate text-ellipsis w-[8rem]">
|
||||
<h1 class="text-2xl font-bold">
|
||||
|
||||
@@ -75,11 +75,11 @@ export default {
|
||||
this.data = data
|
||||
})
|
||||
|
||||
this.following = await getFollows()
|
||||
this.following = await getFollows()
|
||||
this.followingStreaming = []
|
||||
|
||||
// There is a max of 35 streamers per request.
|
||||
for (let i = 0; i <= Math.floor(this.following.length / 35); i ++) {
|
||||
for (let i = 0; i <= Math.floor(this.following.length / 35); i++) {
|
||||
const liveStreamers = await followersStreaming(this.following, i)
|
||||
this.followingStreaming = [...this.followingStreaming, ...liveStreamers]
|
||||
}
|
||||
@@ -105,7 +105,9 @@ export default {
|
||||
<div v-if="following && following.length > 0" class="p-2 text-contrast mb-4">
|
||||
<h1 class="font-bold text-5xl">{{ $t('home.following') }}</h1>
|
||||
<p class="text-xl mb-2">{{ $t('home.streamersYouFollow') }}</p>
|
||||
<ul class="overflow-x-auto whitespace-nowrap flex grid grid-rows-2 auto-cols-min gap-2 grid-flow-col">
|
||||
<ul
|
||||
class="overflow-x-auto whitespace-nowrap flex grid grid-rows-2 auto-cols-min gap-2 grid-flow-col"
|
||||
>
|
||||
<li v-for="streamer in followingStreaming" :key="streamer" class="mr-2">
|
||||
<stream-preview-vue :name="streamer"></stream-preview-vue>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user