Skip to content

Commit 6637c7b

Browse files
committed
fix: blob image response and remove drawer masks
1 parent d2c5b8a commit 6637c7b

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

app/components/LocationDrawerContent.vue

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { onLongPress, useScroll } from '@vueuse/core'
2+
import { onLongPress } from '@vueuse/core'
33
44
const { location, snap } = defineProps<{
55
location: LocationDetailResponse
@@ -12,14 +12,6 @@ const emit = defineEmits<{
1212
1313
const { t, locale } = useI18n()
1414
15-
// Scroll container ref and scroll state
16-
const scrollContainer = useTemplateRef<HTMLElement>('scrollContainer')
17-
const { y: scrollY, arrivedState } = useScroll(scrollContainer)
18-
19-
// Mask visibility based on scroll position
20-
const showTopMask = computed(() => scrollY.value > 0)
21-
const showBottomMask = computed(() => !arrivedState.bottom)
22-
2315
// Simple derived values
2416
const primaryCategory = computed(() => location.primaryCategory ?? location.categories?.[0] ?? null)
2517
const hasRating = computed(() => location.rating && location.ratingCount)
@@ -106,12 +98,8 @@ const { addressRef, showCopiedTooltip } = useAddressCopy()
10698

10799
<template>
108100
<div bg-neutral-0 w-full h-full relative of-hidden flex="~ col">
109-
<!-- Scroll masks for fade effect -->
110-
<div v-show="showTopMask" pointer-events-none absolute inset-x-0 top-0 h-32 z-10 bg-gradient-to-b from-white to-transparent />
111-
<div v-show="showBottomMask && isCompact" pointer-events-none absolute inset-x-0 bottom-0 h-32 z-10 bg-gradient-to-t from-white to-transparent />
112-
113101
<!-- Scrollable content -->
114-
<div ref="scrollContainer" of-y-auto of-x-hidden flex-1 :class="isCompact ? 'max-h-[calc(450px-32px)]' : ''">
102+
<div of-y-auto of-x-hidden flex-1 :class="isCompact ? 'max-h-[calc(450px-32px)]' : ''">
115103
<header bg-neutral-0 relative f-px-md>
116104
<!-- Close Button -->
117105
<div flex="~ shrink-0 gap-8" right-16 top-4 absolute z-20>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default eventHandler(async (event) => {
7878
if (isValidImage(cachedContentType, cachedBuffer)) {
7979
setHeader(event, 'Content-Type', cachedContentType)
8080
setHeader(event, 'Cache-Control', 'public, max-age=31536000, immutable')
81-
return cachedBuffer
81+
return Buffer.from(cachedBuffer)
8282
}
8383

8484
// Delete invalid cached images
@@ -138,7 +138,7 @@ export default eventHandler(async (event) => {
138138
// Serve image directly
139139
setHeader(event, 'Content-Type', contentType)
140140
setHeader(event, 'Cache-Control', 'public, max-age=31536000, immutable')
141-
return imageBuffer
141+
return Buffer.from(imageBuffer)
142142
}
143143

144144
throw createError({ statusCode: 404, message: 'Image not found' })

0 commit comments

Comments
 (0)