mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-14 00:04:59 -05:00
chore(ui): lint
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
import { useStore } from '@nanostores/react';
|
||||
import { toast } from 'features/toast/toast';
|
||||
import { useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useDeleteQueueItemsByDestinationMutation } from 'services/api/endpoints/queue';
|
||||
import { $isConnected } from 'services/events/stores';
|
||||
|
||||
export const useDeleteQueueItemsByDestination = () => {
|
||||
const isConnected = useStore($isConnected);
|
||||
const [_trigger, { isLoading }] = useDeleteQueueItemsByDestinationMutation();
|
||||
const { t } = useTranslation();
|
||||
const trigger = useCallback(
|
||||
async (destination: string) => {
|
||||
try {
|
||||
await _trigger({ destination }).unwrap();
|
||||
toast({
|
||||
id: 'QUEUE_CANCEL_SUCCEEDED',
|
||||
title: t('queue.cancelSucceeded'),
|
||||
status: 'success',
|
||||
});
|
||||
} catch {
|
||||
toast({
|
||||
id: 'QUEUE_CANCEL_FAILED',
|
||||
title: t('queue.cancelFailed'),
|
||||
status: 'error',
|
||||
});
|
||||
}
|
||||
},
|
||||
[t, _trigger]
|
||||
);
|
||||
|
||||
return { trigger, isLoading, isDisabled: !isConnected };
|
||||
};
|
||||
@@ -383,7 +383,6 @@ export const {
|
||||
useCancelQueueItemsByDestinationMutation,
|
||||
|
||||
useDeleteQueueItemMutation,
|
||||
useDeleteQueueItemsByDestinationMutation,
|
||||
useDeleteAllExceptCurrentMutation,
|
||||
useGetBatchStatusQuery,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user