fix(ui): the bottom button on floating side panel clears all queue items

This commit is contained in:
Thomas Mello 2024-01-30 16:45:14 +03:00 committed by psychedelicious
parent 4477e04d59
commit d7f16b7c87
2 changed files with 8 additions and 4 deletions

View File

@ -12,7 +12,7 @@ type ClearQueueIconButtonProps = ClearQueueButtonProps & {
onOpen: () => void;
};
const ClearAllQueueIconButton = ({ onOpen, ...props }: ClearQueueIconButtonProps) => {
export const ClearAllQueueIconButton = ({ onOpen, ...props }: ClearQueueIconButtonProps) => {
const { t } = useTranslation();
const { isLoading, isDisabled } = useClearQueue();

View File

@ -1,7 +1,8 @@
import type { SystemStyleObject } from '@invoke-ai/ui-library';
import { ButtonGroup, Flex, Icon, IconButton, Portal, spinAnimation } from '@invoke-ai/ui-library';
import { ButtonGroup, Flex, Icon, IconButton, Portal, spinAnimation, useDisclosure } from '@invoke-ai/ui-library';
import CancelCurrentQueueItemIconButton from 'features/queue/components/CancelCurrentQueueItemIconButton';
import ClearQueueIconButton from 'features/queue/components/ClearQueueIconButton';
import ClearQueueConfirmationAlertDialog from 'features/queue/components/ClearQueueConfirmationAlertDialog';
import { ClearAllQueueIconButton } from 'features/queue/components/ClearQueueIconButton';
import { QueueButtonTooltip } from 'features/queue/components/QueueButtonTooltip';
import { useQueueBack } from 'features/queue/hooks/useQueueBack';
import type { UsePanelReturn } from 'features/ui/hooks/usePanel';
@ -35,6 +36,8 @@ const FloatingSidePanelButtons = (props: Props) => {
[isDisabled, queueStatus?.processor.is_processing]
);
const disclosure = useDisclosure();
if (!props.panelApi.isCollapsed) {
return null;
}
@ -71,7 +74,8 @@ const FloatingSidePanelButtons = (props: Props) => {
/>
<CancelCurrentQueueItemIconButton sx={floatingButtonStyles} />
</ButtonGroup>
<ClearQueueIconButton sx={floatingButtonStyles} />
<ClearAllQueueIconButton sx={floatingButtonStyles} onOpen={disclosure.onOpen} />
<ClearQueueConfirmationAlertDialog disclosure={disclosure} />
</Flex>
</Portal>
);