mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): only disable cancel item button if value is null/undefined
0 is falsy and the `item_id` is an integer
This commit is contained in:
parent
b3f4f28d76
commit
98a076260b
@ -1,5 +1,6 @@
|
|||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import { addToast } from 'features/system/store/systemSlice';
|
import { addToast } from 'features/system/store/systemSlice';
|
||||||
|
import { isNil } from 'lodash-es';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {
|
import {
|
||||||
@ -40,7 +41,7 @@ export const useCancelCurrentQueueItem = () => {
|
|||||||
}, [currentQueueItemId, dispatch, t, trigger]);
|
}, [currentQueueItemId, dispatch, t, trigger]);
|
||||||
|
|
||||||
const isDisabled = useMemo(
|
const isDisabled = useMemo(
|
||||||
() => !isConnected || !currentQueueItemId,
|
() => !isConnected || isNil(currentQueueItemId),
|
||||||
[isConnected, currentQueueItemId]
|
[isConnected, currentQueueItemId]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user