From e2e37695cde7c38121948cd901755b4d24d6fcd2 Mon Sep 17 00:00:00 2001 From: EthanHealy01 Date: Tue, 5 May 2026 17:50:09 +0100 Subject: [PATCH] fix: use ?? instead of || so empty thumbnail string skips generation --- frontend/src/core/contexts/IndexedDBContext.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/core/contexts/IndexedDBContext.tsx b/frontend/src/core/contexts/IndexedDBContext.tsx index ca8702917b..dffdaeb50b 100644 --- a/frontend/src/core/contexts/IndexedDBContext.tsx +++ b/frontend/src/core/contexts/IndexedDBContext.tsx @@ -92,9 +92,10 @@ export function IndexedDBProvider({ children }: IndexedDBProviderProps) { fileId: FileId, existingThumbnail?: string, ): Promise => { - // Use existing thumbnail or generate new one if none provided (empty string = no raster thumbnail) + // existingThumbnail="" means caller explicitly opted out of a raster thumbnail; + // only generate when the caller passed nothing (undefined). const generated = - existingThumbnail || (await generateThumbnailForFile(file)); + existingThumbnail ?? (await generateThumbnailForFile(file)); const thumbnail = generated || undefined; // History is handled via direct fileStorage calls, not here