mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-21 14:36:31 +00:00
Keep a picked place image and its credit visible everywhere
Accommodation cards read the place from page-local state, so a new thumbnail only showed up there after a reload. place:updated now asks the planner to reload them, but only when the image actually changed - renaming a place must not trigger a refetch. The inspector shows the stored credit under the avatar. Crediting a CC BY-SA picture only in the moment it is chosen is not enough; the obligation travels with the picture. Also lets a GIF hero through to the PDF. Uploads accept gif, the PDF extension check did not, so one silently fell back to the category icon.
This commit is contained in:
@@ -93,7 +93,9 @@ function safeImg(url) {
|
||||
// (it ends in …/bytes), so the extension check below would wrongly reject it —
|
||||
// which is why persisted place photos showed as category icons in the PDF.
|
||||
if (url.startsWith('/api/maps/place-photo/')) return absUrl(url)
|
||||
return /\.(jpe?g|png|webp|bmp|tiff?)(\?.*)?$/i.test(url) ? absUrl(url) : null
|
||||
// gif is in the list because place-image-upload.ts accepts it; without it an
|
||||
// uploaded GIF hero silently fell back to the category icon in the PDF.
|
||||
return /\.(jpe?g|png|gif|webp|bmp|tiff?)(\?.*)?$/i.test(url) ? absUrl(url) : null
|
||||
}
|
||||
|
||||
// Generate SVG string from Lucide icon name (for category thumbnails)
|
||||
|
||||
Reference in New Issue
Block a user