mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
feat(ui): rerender mitigation sweep
This commit is contained in:
@@ -6,14 +6,12 @@ import IAIIconButton, {
|
||||
import { systemSelector } from 'features/system/store/systemSelectors';
|
||||
import {
|
||||
SystemState,
|
||||
setCancelAfter,
|
||||
setCancelType,
|
||||
cancelScheduled,
|
||||
cancelTypeChanged,
|
||||
CancelType,
|
||||
} from 'features/system/store/systemSlice';
|
||||
import { isEqual } from 'lodash-es';
|
||||
import { useEffect, useCallback, memo } from 'react';
|
||||
import { useCallback, memo } from 'react';
|
||||
import {
|
||||
ButtonSpinner,
|
||||
ButtonGroup,
|
||||
@@ -27,16 +25,9 @@ import {
|
||||
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
MdArrowDropDown,
|
||||
MdArrowDropUp,
|
||||
MdCancel,
|
||||
MdCancelScheduleSend,
|
||||
} from 'react-icons/md';
|
||||
import { MdCancel, MdCancelScheduleSend } from 'react-icons/md';
|
||||
|
||||
import IAISimpleMenu from 'common/components/IAISimpleMenu';
|
||||
import { sessionCanceled } from 'services/thunks/session';
|
||||
import { FaChevronDown } from 'react-icons/fa';
|
||||
import { BiChevronDown } from 'react-icons/bi';
|
||||
|
||||
const cancelButtonSelector = createSelector(
|
||||
@@ -48,8 +39,6 @@ const cancelButtonSelector = createSelector(
|
||||
isCancelable: system.isCancelable,
|
||||
currentIteration: system.currentIteration,
|
||||
totalIterations: system.totalIterations,
|
||||
// cancelType: system.cancelOptions.cancelType,
|
||||
// cancelAfter: system.cancelOptions.cancelAfter,
|
||||
sessionId: system.sessionId,
|
||||
cancelType: system.cancelType,
|
||||
isCancelScheduled: system.isCancelScheduled,
|
||||
@@ -75,11 +64,8 @@ const CancelButton = (
|
||||
isProcessing,
|
||||
isConnected,
|
||||
isCancelable,
|
||||
currentIteration,
|
||||
totalIterations,
|
||||
cancelType,
|
||||
isCancelScheduled,
|
||||
// cancelAfter,
|
||||
sessionId,
|
||||
} = useAppSelector(cancelButtonSelector);
|
||||
|
||||
@@ -105,7 +91,6 @@ const CancelButton = (
|
||||
},
|
||||
[dispatch]
|
||||
);
|
||||
// const isCancelScheduled = cancelAfter === null ? false : true;
|
||||
|
||||
useHotkeys(
|
||||
'shift+x',
|
||||
@@ -117,23 +102,6 @@ const CancelButton = (
|
||||
[isConnected, isProcessing, isCancelable]
|
||||
);
|
||||
|
||||
// useEffect(() => {
|
||||
// if (cancelAfter !== null && cancelAfter < currentIteration) {
|
||||
// handleClickCancel();
|
||||
// }
|
||||
// }, [cancelAfter, currentIteration, handleClickCancel]);
|
||||
|
||||
// const cancelMenuItems = [
|
||||
// {
|
||||
// item: t('parameters.cancel.immediate'),
|
||||
// onClick: () => dispatch(cancelTypeChanged('immediate')),
|
||||
// },
|
||||
// {
|
||||
// item: t('parameters.cancel.schedule'),
|
||||
// onClick: () => dispatch(cancelTypeChanged('scheduled')),
|
||||
// },
|
||||
// ];
|
||||
|
||||
return (
|
||||
<ButtonGroup isAttached width={btnGroupWidth}>
|
||||
{cancelType === 'immediate' ? (
|
||||
|
||||
Reference in New Issue
Block a user