mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-10-17 10:50:46 +02:00
Fix LibrarySelect
This commit is contained in:
@@ -33,7 +33,7 @@ export interface LibrarySelectProps {
|
|||||||
|
|
||||||
const props = defineProps<LibrarySelectProps>();
|
const props = defineProps<LibrarySelectProps>();
|
||||||
|
|
||||||
const library = computed(() => props.libraryId);
|
const library = ref(props.libraryId);
|
||||||
const { data: libraries } = await useApi('/v2/FileLibrary', { key: FetchKeys.FileLibraries });
|
const { data: libraries } = await useApi('/v2/FileLibrary', { key: FetchKeys.FileLibraries });
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
@@ -46,5 +46,10 @@ const onLibrarySelectChange = async () => {
|
|||||||
});
|
});
|
||||||
await refreshNuxtData(FetchKeys.Manga.Id(props.mangaId));
|
await refreshNuxtData(FetchKeys.Manga.Id(props.mangaId));
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
emit('libraryChanged', library.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'libraryChanged', id?: string): void;
|
||||||
|
}>();
|
||||||
</script>
|
</script>
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<h1 class="font-semibold">Download</h1>
|
<h1 class="font-semibold">Download</h1>
|
||||||
</template>
|
</template>
|
||||||
<LibrarySelect :manga-id="mangaId" :library-id="manga?.fileLibraryId" class="w-full" />
|
<LibrarySelect :manga-id="mangaId" :library-id="manga?.fileLibraryId" class="w-full" @library-changed="refreshNuxtData(FetchKeys.Manga.Id(mangaId))" />
|
||||||
<div v-if="manga" class="flex flex-row gap-2 w-full flex-wrap my-2 justify-between">
|
<div v-if="manga" class="flex flex-row gap-2 w-full flex-wrap my-2 justify-between">
|
||||||
<div
|
<div
|
||||||
v-for="mangaconnectorId in manga.mangaConnectorIds.sort((a, b) =>
|
v-for="mangaconnectorId in manga.mangaConnectorIds.sort((a, b) =>
|
||||||
|
Reference in New Issue
Block a user