Prevent empty favs tag
This commit is contained in:
parent
0f632fe236
commit
4c3c2a73ef
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user