mirror of
https://github.com/stablyai/orca.git
synced 2026-10-07 08:02:21 +00:00
refactor(feedback): seed the image read queue ref directly
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user