From 4c3c2a73ef417748b847e5fd7337783ad9a1cb07 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sun, 31 Dec 2023 21:44:40 -0500 Subject: [PATCH] Prevent empty favs tag --- src/photo/data.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/photo/data.ts b/src/photo/data.ts index 26ed3f67..b06b5790 100644 --- a/src/photo/data.ts +++ b/src/photo/data.ts @@ -5,13 +5,13 @@ import { getUniqueTagsCached, } from '@/cache'; import { SHOW_FILM_SIMULATIONS } from '@/site/config'; -import { TAG_FAVS, Tags } from '@/tag'; +import { TAG_FAVS } from '@/tag'; export const getPhotoSidebarDataCached = () => [ getPhotosCountCached(), getUniqueTagsCached().then(tags => - ([tags.find(({ tag }) => tag === TAG_FAVS) ?? []] as Tags) - .concat(tags.filter(({ tag }) => tag !== TAG_FAVS))), + tags.filter(({ tag }) => tag === TAG_FAVS).concat( + tags.filter(({ tag }) => tag !== TAG_FAVS))), getUniqueCamerasCached(), SHOW_FILM_SIMULATIONS ? getUniqueFilmSimulationsCached() : [], ] as const;