mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): the bottom button on floating side panel clears all queue items
This commit is contained in:
parent
4477e04d59
commit
d7f16b7c87
@ -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();
|
||||
|
||||
|
@ -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>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user