kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
fix(front): alert and no duplicate libraries in library widget
rodzic
0696298413
commit
d936e330d6
|
@ -11,6 +11,7 @@ import LibraryCard from '~/views/content/remote/Card.vue'
|
|||
import Button from '~/components/ui/Button.vue'
|
||||
import Section from '~/components/ui/Section.vue'
|
||||
import Loader from '~/components/ui/Loader.vue'
|
||||
import Alert from '~/components/ui/Alert.vue'
|
||||
|
||||
import useErrorHandler from '~/composables/useErrorHandler'
|
||||
|
||||
|
@ -43,7 +44,7 @@ const fetchData = async (url = props.url) => {
|
|||
})
|
||||
|
||||
nextPage.value = response.data.next
|
||||
libraries.push(...response.data.results)
|
||||
libraries.splice(0, libraries.length, ...response.data.results)
|
||||
emit('loaded', libraries)
|
||||
} catch (error) {
|
||||
useErrorHandler(error as Error)
|
||||
|
@ -68,20 +69,12 @@ watch(() => props.url, () => {
|
|||
small-items
|
||||
>
|
||||
<Loader v-if="isLoading" style="grid-column: 1 / -1;" />
|
||||
<p
|
||||
v-if="!isLoading && libraries.length > 0"
|
||||
style="grid-column: 1 / -1;"
|
||||
class="ui subtitle"
|
||||
>
|
||||
<slot />
|
||||
</p>
|
||||
<p
|
||||
<Alert blue
|
||||
v-if="!isLoading && libraries.length === 0"
|
||||
style="grid-column: 1 / -1;"
|
||||
class="ui subtitle"
|
||||
>
|
||||
{{ t('components.federation.LibraryWidget.empty.noMatch') }}
|
||||
</p>
|
||||
</Alert>
|
||||
<library-card
|
||||
v-for="library in libraries"
|
||||
:key="library.uuid"
|
||||
|
|
Ładowanie…
Reference in New Issue