fix(ui): image metadata viewer stuck when spamming hotkey

This commit is contained in:
psychedelicious 2024-05-07 09:50:54 +10:00
parent 886f5c90a3
commit e8d60e8d83

View File

@ -103,24 +103,11 @@ const CurrentImagePreview = ({
dataTestId="image-preview"
/>
)}
<AnimatePresence>
{shouldShowImageDetails && imageDTO && withMetadata && (
<Box
as={motion.div}
key="metadataViewer"
initial={initial}
animate={animateMetadata}
exit={exit}
position="absolute"
top={0}
width="full"
height="full"
borderRadius="base"
>
<Box position="absolute" opacity={0.8} top={0} width="full" height="full" borderRadius="base">
<ImageMetadataViewer image={imageDTO} />
</Box>
)}
</AnimatePresence>
<AnimatePresence>
{withNextPrevButtons && shouldShowNextPrevButtons && imageDTO && (
<Box
@ -152,10 +139,6 @@ const animateArrows: AnimationProps['animate'] = {
opacity: 1,
transition: { duration: 0.07 },
};
const animateMetadata: AnimationProps['animate'] = {
opacity: 0.8,
transition: { duration: 0.07 },
};
const exit: AnimationProps['exit'] = {
opacity: 0,
transition: { duration: 0.07 },