fix: sync canvas placeholder with chat loading
This commit is contained in:
parent
ef89ab1aeb
commit
072fac14cc
@ -8371,8 +8371,35 @@ export function CanvasChatPanel({
|
|||||||
streamImageGenerationState?.sameModelRunningCount;
|
streamImageGenerationState?.sameModelRunningCount;
|
||||||
const loadingConcurrencyLimit = streamImageGenerationState?.concurrencyLimit;
|
const loadingConcurrencyLimit = streamImageGenerationState?.concurrencyLimit;
|
||||||
const loadingEstimatedWaitMs = streamImageGenerationState?.estimatedWaitMs;
|
const loadingEstimatedWaitMs = streamImageGenerationState?.estimatedWaitMs;
|
||||||
|
const canvasGenerationPlaceholderState =
|
||||||
|
useMemo<ImageGenerationStatusStreamPayload | null>(() => {
|
||||||
|
if (!shouldShowImageLoading) return null;
|
||||||
|
if (streamImageGenerationState) return streamImageGenerationState;
|
||||||
|
|
||||||
|
return {
|
||||||
|
phase: loadingPhase,
|
||||||
|
providerType: loadingProviderType,
|
||||||
|
modelName: loadingModelName,
|
||||||
|
imageCount: loadingImageCount,
|
||||||
|
queuePosition: loadingQueuePosition,
|
||||||
|
sameModelRunningCount: loadingSameModelRunningCount,
|
||||||
|
concurrencyLimit: loadingConcurrencyLimit,
|
||||||
|
estimatedWaitMs: loadingEstimatedWaitMs,
|
||||||
|
};
|
||||||
|
}, [
|
||||||
|
loadingConcurrencyLimit,
|
||||||
|
loadingEstimatedWaitMs,
|
||||||
|
loadingImageCount,
|
||||||
|
loadingModelName,
|
||||||
|
loadingPhase,
|
||||||
|
loadingProviderType,
|
||||||
|
loadingQueuePosition,
|
||||||
|
loadingSameModelRunningCount,
|
||||||
|
shouldShowImageLoading,
|
||||||
|
streamImageGenerationState,
|
||||||
|
]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const streamState = streamImageGenerationStateByChatId[activeChatId] || null;
|
const streamState = canvasGenerationPlaceholderState;
|
||||||
const placeholderId = canvasGenerationPlaceholderByChatIdRef.current[activeChatId];
|
const placeholderId = canvasGenerationPlaceholderByChatIdRef.current[activeChatId];
|
||||||
|
|
||||||
if (!streamState) {
|
if (!streamState) {
|
||||||
@ -8504,10 +8531,10 @@ export function CanvasChatPanel({
|
|||||||
currentModel?.displayName,
|
currentModel?.displayName,
|
||||||
currentModel?.providerType,
|
currentModel?.providerType,
|
||||||
imageParams,
|
imageParams,
|
||||||
|
canvasGenerationPlaceholderState,
|
||||||
focusCanvasOnNode,
|
focusCanvasOnNode,
|
||||||
removeCanvasGenerationPlaceholders,
|
removeCanvasGenerationPlaceholders,
|
||||||
selectNodes,
|
selectNodes,
|
||||||
streamImageGenerationStateByChatId,
|
|
||||||
updateNode,
|
updateNode,
|
||||||
]);
|
]);
|
||||||
const renderableVisibleMessages = useMemo(() => {
|
const renderableVisibleMessages = useMemo(() => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user