refactor(feedback): seed the image read queue ref directly

This commit is contained in:
Brennan Benson
2026-10-01 02:21:55 -07:00
parent cdf965019b
commit e2272b825e
@@ -37,8 +37,7 @@ export function useSidebarFeedbackImages(params: {
const pendingImageReadsRef = useRef({ count: 0, bytes: 0 })
// Why: a shrunk image's size is unknown until it is read, so batches read one
// at a time, each sized against what the batches before it actually committed.
const readQueueRef = useRef<Promise<void>>(undefined!)
readQueueRef.current ??= Promise.resolve()
const readQueueRef = useRef<Promise<void>>(Promise.resolve())
const clearImages = useCallback(() => {
liveImageDraftsRef.current.forEach(releaseFeedbackImageDraft)