{selectedTag.name}
diff --git a/app/routes/tags.all.tsx b/app/routes/tags.all.tsx
index 99301768..030a39f3 100644
--- a/app/routes/tags.all.tsx
+++ b/app/routes/tags.all.tsx
@@ -6,15 +6,19 @@ import {reloadInBackgroundIfNeeded} from '~/server-utils/kv-cache'
export const loader = async ({request, params}: Parameters[0]) => {
const {data: tags, timestamp} = await loadTags(request)
- const tagId = params['*'] && params['*'].split('/')[0]
+ let tagId = params['*'] && params['*'].split('/')[0]
+ if (tagId === '') {
+ tagId = undefined
+ }
+
const currentTag = tagId
- ? tags.find(({tagId: checkedId, name}) => [checkedId.toString(), name].includes(tagId))
- : tags[0]
+ ? tags.find(({tagId: checkedId, name}) => [checkedId.toString(), name].includes(tagId!))
+ : undefined
- if (currentTag === undefined) {
+ if (currentTag === undefined && tagId !== undefined) {
throw new Response(null, {
status: 404,
- statusText: 'Unable to find requested tag',
+ statusText: 'Unable to find requested tag -d',
})
}