Skip to content

Commit 2e0cebb

Browse files
fix(ui): bug where viewer would disappear on upscaling tab
1 parent c3a8184 commit 2e0cebb

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ import CurrentImageButtons from './CurrentImageButtons';
99
import { ViewerToggleMenu } from './ViewerToggleMenu';
1010

1111
export const ViewerToolbar = memo(() => {
12-
const tab = useAppSelector(activeTabNameSelector);
12+
const showToggle = useAppSelector((s) => {
13+
const tab = activeTabNameSelector(s);
14+
if (tab === 'upscaling' || tab === 'workflows') {
15+
return false;
16+
}
17+
return true;
18+
});
1319
return (
1420
<Flex w="full" gap={2}>
1521
<Flex flex={1} justifyContent="center">
@@ -23,7 +29,7 @@ export const ViewerToolbar = memo(() => {
2329
</Flex>
2430
<Flex flex={1} justifyContent="center">
2531
<Flex gap={2} marginInlineStart="auto">
26-
{tab !== 'workflows' && <ViewerToggleMenu />}
32+
{showToggle && <ViewerToggleMenu />}
2733
</Flex>
2834
</Flex>
2935
</Flex>

invokeai/frontend/web/src/features/ui/components/tabs/UpscalingTab.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { Box } from '@invoke-ai/ui-library';
22
import { ImageViewer } from 'features/gallery/components/ImageViewer/ImageViewer';
3-
import { useImageViewer } from 'features/gallery/components/ImageViewer/useImageViewer';
43
import { memo } from 'react';
54

65
const UpscalingTab = () => {
7-
const imageViewer = useImageViewer();
86
return (
97
<Box layerStyle="first" position="relative" w="full" h="full" p={2} borderRadius="base">
10-
{imageViewer.isOpen && <ImageViewer />}
8+
<ImageViewer />
119
</Box>
1210
);
1311
};

0 commit comments

Comments
 (0)