Skip to content

Commit e8d60e8

Browse files
fix(ui): image metadata viewer stuck when spamming hotkey
1 parent 886f5c9 commit e8d60e8

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

invokeai/frontend/web/src/features/gallery/components/ImageViewer/CurrentImagePreview.tsx

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -103,24 +103,11 @@ const CurrentImagePreview = ({
103103
dataTestId="image-preview"
104104
/>
105105
)}
106-
<AnimatePresence>
107-
{shouldShowImageDetails && imageDTO && withMetadata && (
108-
<Box
109-
as={motion.div}
110-
key="metadataViewer"
111-
initial={initial}
112-
animate={animateMetadata}
113-
exit={exit}
114-
position="absolute"
115-
top={0}
116-
width="full"
117-
height="full"
118-
borderRadius="base"
119-
>
120-
<ImageMetadataViewer image={imageDTO} />
121-
</Box>
122-
)}
123-
</AnimatePresence>
106+
{shouldShowImageDetails && imageDTO && withMetadata && (
107+
<Box position="absolute" opacity={0.8} top={0} width="full" height="full" borderRadius="base">
108+
<ImageMetadataViewer image={imageDTO} />
109+
</Box>
110+
)}
124111
<AnimatePresence>
125112
{withNextPrevButtons && shouldShowNextPrevButtons && imageDTO && (
126113
<Box
@@ -152,10 +139,6 @@ const animateArrows: AnimationProps['animate'] = {
152139
opacity: 1,
153140
transition: { duration: 0.07 },
154141
};
155-
const animateMetadata: AnimationProps['animate'] = {
156-
opacity: 0.8,
157-
transition: { duration: 0.07 },
158-
};
159142
const exit: AnimationProps['exit'] = {
160143
opacity: 0,
161144
transition: { duration: 0.07 },

0 commit comments

Comments
 (0)