fix(ui): floating params panel invoke button loading state

This commit is contained in:
psychedelicious 2024-08-29 08:42:22 +10:00
parent 38ed720ff2
commit d60605fcd8

View File

@ -25,15 +25,13 @@ const FloatingSidePanelButtons = (props: Props) => {
const { queueBack, isLoading, isDisabled } = useQueueBack();
const { data: queueStatus } = useGetQueueStatusQuery();
const queueButtonIcon = useMemo(
() =>
!isDisabled && queueStatus?.processor.is_processing ? (
<Icon boxSize={6} as={PiCircleNotchBold} animation={spinAnimation} />
) : (
<RiSparklingFill size="16px" />
),
[isDisabled, queueStatus?.processor.is_processing]
);
const queueButtonIcon = useMemo(() => {
const isProcessing = (queueStatus?.queue.in_progress ?? 0) > 0;
if (!isDisabled && isProcessing) {
return <Icon boxSize={6} as={PiCircleNotchBold} animation={spinAnimation} />;
}
return <RiSparklingFill size="16px" />;
}, [isDisabled, queueStatus]);
if (!props.panelApi.isCollapsed) {
return null;