mirror of
https://codeberg.org/SafeTwitch/safetwitch.git
synced 2024-12-22 13:22:58 -05:00
Add message when following no one
This commit is contained in:
parent
531653c9c8
commit
9d105cbe93
2 changed files with 18 additions and 3 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 688f74e9b5651adb080f540419dc196791058419
|
||||
Subproject commit a808443069fb20faf1696cba510f905c492c67f9
|
|
@ -3,6 +3,7 @@ import { ref, inject } from 'vue'
|
|||
|
||||
import FollowButton from '@/components/FollowButton.vue'
|
||||
import LoadingScreen from '@/components/LoadingScreen.vue'
|
||||
import ErrorMessage from '@/components/ErrorMessage.vue'
|
||||
|
||||
import { getFollows } from '@/settingsManager'
|
||||
import { postEndpoint, abbreviate } from '@/mixins'
|
||||
|
@ -30,6 +31,12 @@ export default {
|
|||
streamers: follows
|
||||
}
|
||||
|
||||
// do not make request if no followers
|
||||
if (follows.length == 0) {
|
||||
this.data = []
|
||||
return
|
||||
}
|
||||
|
||||
await postEndpoint('api/users/bulk', payload)
|
||||
.catch(() => {
|
||||
this.status = 'error'
|
||||
|
@ -40,13 +47,21 @@ export default {
|
|||
},
|
||||
components: {
|
||||
LoadingScreen,
|
||||
FollowButton
|
||||
FollowButton,
|
||||
ErrorMessage
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<loading-screen v-if="!data && status != 'error'"></loading-screen>
|
||||
<div class="md:max-w-[50rem] w-full mx-auto text-contrast flex justify-center">
|
||||
<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 justify-center">
|
||||
<div v-if="data.length == 0" class="text-center">
|
||||
<h1 class="text-3xl font-bold">{{ $t("following.empty") }}</h1>
|
||||
<p>{{ $t("following.followAdvice") }}</p>
|
||||
</div>
|
||||
|
||||
<ul class="m-2 flex flex-wrap justify-center">
|
||||
<li v-for="streamer in data" class="">
|
||||
<div class="inline-flex bg-overlay0 p-2.5 m-1 rounded-md w-[22rem]">
|
||||
|
|
Loading…
Reference in a new issue