Skip to content

Commit 7c52bd0

Browse files
committed
feat: add gym map pin with updated color
1 parent a8bef87 commit 7c52bd0

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

app/utils/category-mapping.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const colors = {
1111
health: '#DC3B45',
1212
lodging: '#E430B1',
1313
transportation: '#2763B1',
14-
sports: '#17a773',
14+
sports: '#228B65',
1515
misc: '#546E7A',
1616
} as const
1717

@@ -180,7 +180,7 @@ const iconMappings: Record<string, string[]> = {
180180
train: ['train_station', 'transit_station', 'subway_station', 'light_rail_station', 'transit_depot'],
181181
bus: ['bus_station', 'bus_stop', 'taxi_stand', 'ferry_terminal'],
182182
golf: ['golf_course'],
183-
misc: ['gym', 'fitness_center'],
183+
gym: ['gym', 'fitness_center'],
184184
}
185185

186186
// Color group → categories (derived from icon mappings)
@@ -192,7 +192,7 @@ const colorGroups = {
192192
health: [...iconMappings.pharmacy!],
193193
lodging: [...iconMappings.lodging!],
194194
transportation: [...iconMappings.airport!, ...iconMappings.train!, ...iconMappings.bus!],
195-
sports: [...iconMappings.golf!, ...iconMappings.misc!],
195+
sports: [...iconMappings.golf!, ...iconMappings.gym!],
196196
misc: [] as string[], // default fallback, no explicit categories
197197
} satisfies Record<keyof typeof colors, string[]>
198198

public/assets/map-pins/gym.svg

Lines changed: 1 addition & 0 deletions
Loading

server/routes/blob/[...pathname].get.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,21 @@ export default eventHandler(async (event) => {
7272
// Check if image exists in cache
7373
const existingImage = await blob.head(pathname).catch(() => null)
7474
if (existingImage) {
75-
const size = Number(existingImage.size ?? Number.NaN)
75+
const size = Number(existingImage.size ?? 0)
7676
const cachedContentType = existingImage.contentType
7777

78-
// Delete invalid cached images (too small or wrong content type)
79-
if (!Number.isNaN(size) && (size < MIN_VALID_IMAGE_BYTES || !cachedContentType?.startsWith('image/'))) {
80-
event.waitUntil(
81-
blob.delete(pathname).catch((error: unknown) => {
82-
consola.warn(`Failed to delete invalid cached image for ${uuid}:`, error, { tag: 'image-proxy' })
83-
}),
84-
)
85-
}
86-
else {
78+
// Only serve if we can verify it's valid (size known and large enough, correct content type)
79+
if (size >= MIN_VALID_IMAGE_BYTES && cachedContentType?.startsWith('image/')) {
8780
setHeader(event, 'Cache-Control', 'public, max-age=31536000, immutable')
8881
return blob.serve(event, pathname)
8982
}
83+
84+
// Delete invalid cached images in background
85+
event.waitUntil(
86+
blob.delete(pathname).catch((error: unknown) => {
87+
consola.warn(`Failed to delete invalid cached image for ${uuid}:`, error, { tag: 'image-proxy' })
88+
}),
89+
)
9090
}
9191

9292
// Fetch gmapsPlaceId from database

0 commit comments

Comments
 (0)