mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
fix(ui): blank viewer when no progress image in last progress event
This commit is contained in:
committed by
Kent Keirsey
parent
d65dd32a17
commit
10fd3e6a0d
@@ -12,7 +12,7 @@ import type { AnimationProps } from 'framer-motion';
|
||||
import { AnimatePresence, motion } from 'framer-motion';
|
||||
import { memo, useCallback, useMemo, useRef, useState } from 'react';
|
||||
import { useGetImageDTOQuery } from 'services/api/endpoints/images';
|
||||
import { $hasProgress, $isProgressFromCanvas } from 'services/events/stores';
|
||||
import { $hasProgressImage, $isProgressFromCanvas } from 'services/events/stores';
|
||||
|
||||
import { NoContentForViewer } from './NoContentForViewer';
|
||||
import ProgressImage from './ProgressImage';
|
||||
@@ -20,7 +20,7 @@ import ProgressImage from './ProgressImage';
|
||||
const CurrentImagePreview = () => {
|
||||
const shouldShowImageDetails = useAppSelector(selectShouldShowImageDetails);
|
||||
const imageName = useAppSelector(selectLastSelectedImageName);
|
||||
const hasDenoiseProgress = useStore($hasProgress);
|
||||
const hasProgressImage = useStore($hasProgressImage);
|
||||
const isProgressFromCanvas = useStore($isProgressFromCanvas);
|
||||
const shouldShowProgressInViewer = useAppSelector(selectShouldShowProgressInViewer);
|
||||
|
||||
@@ -59,7 +59,7 @@ const CurrentImagePreview = () => {
|
||||
justifyContent="center"
|
||||
position="relative"
|
||||
>
|
||||
{hasDenoiseProgress && !isProgressFromCanvas && shouldShowProgressInViewer ? (
|
||||
{hasProgressImage && !isProgressFromCanvas && shouldShowProgressInViewer ? (
|
||||
<ProgressImage />
|
||||
) : (
|
||||
<IAIDndImage
|
||||
|
||||
@@ -9,4 +9,5 @@ export const $isConnected = atom<boolean>(false);
|
||||
export const $lastProgressEvent = atom<S['InvocationProgressEvent'] | null>(null);
|
||||
export const $hasProgress = computed($lastProgressEvent, (val) => Boolean(val));
|
||||
export const $progressImage = computed($lastProgressEvent, (val) => val?.image ?? null);
|
||||
export const $hasProgressImage = computed($lastProgressEvent, (val) => Boolean(val?.image));
|
||||
export const $isProgressFromCanvas = computed($lastProgressEvent, (val) => val?.destination === 'canvas');
|
||||
|
||||
Reference in New Issue
Block a user