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>
|
||||
<main class="flex flex-col">
|
||||
<main v-if="page.inspirations" class="flex flex-col">
|
||||
<header class="flex">
|
||||
<h2 id="tabslist" class="sr-only">Inspirations</h2>
|
||||
<Tabs :tabs="tabs" @update:currentTab="changeTab" />
|
||||
|
|
@ -47,9 +47,10 @@ const currentTab = ref("all");
|
|||
const currentInspiration = ref(page.value.inspirations[0]);
|
||||
|
||||
// Computed
|
||||
const allImages = computed(() =>
|
||||
page.value.inspirations.flatMap((inspiration) => inspiration.media)
|
||||
);
|
||||
const allImages = computed(() => {
|
||||
if (!page.value.inspirations) return [];
|
||||
return page.value.inspirations.flatMap((inspiration) => inspiration.media);
|
||||
});
|
||||
|
||||
const favoriteImages = computed(() =>
|
||||
allImages.value.filter(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue