fix inspirations error on page change
This commit is contained in:
parent
aa90a57e40
commit
baf747f4b6
1 changed files with 5 additions and 4 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<main class="flex flex-col">
|
<main v-if="page.inspirations" class="flex flex-col">
|
||||||
<header class="flex">
|
<header class="flex">
|
||||||
<h2 id="tabslist" class="sr-only">Inspirations</h2>
|
<h2 id="tabslist" class="sr-only">Inspirations</h2>
|
||||||
<Tabs :tabs="tabs" @update:currentTab="changeTab" />
|
<Tabs :tabs="tabs" @update:currentTab="changeTab" />
|
||||||
|
|
@ -47,9 +47,10 @@ const currentTab = ref("all");
|
||||||
const currentInspiration = ref(page.value.inspirations[0]);
|
const currentInspiration = ref(page.value.inspirations[0]);
|
||||||
|
|
||||||
// Computed
|
// Computed
|
||||||
const allImages = computed(() =>
|
const allImages = computed(() => {
|
||||||
page.value.inspirations.flatMap((inspiration) => inspiration.media)
|
if (!page.value.inspirations) return [];
|
||||||
);
|
return page.value.inspirations.flatMap((inspiration) => inspiration.media);
|
||||||
|
});
|
||||||
|
|
||||||
const favoriteImages = computed(() =>
|
const favoriteImages = computed(() =>
|
||||||
allImages.value.filter(
|
allImages.value.filter(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue