Skip to content

Commit e78fb42

Browse files
committed
simplify destination prop handling
1 parent 31e270e commit e78fb42

File tree

4 files changed

+9
-37
lines changed

4 files changed

+9
-37
lines changed

invokeai/frontend/web/src/app/components/App.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { configChanged } from 'features/system/store/configSlice';
1717
import { languageSelector } from 'features/system/store/systemSelectors';
1818
import InvokeTabs from 'features/ui/components/InvokeTabs';
1919
import type { InvokeTabName } from 'features/ui/store/tabMap';
20+
import { setActiveTab } from 'features/ui/store/uiSlice';
2021
import { AnimatePresence } from 'framer-motion';
2122
import i18n from 'i18n';
2223
import { size } from 'lodash-es';
@@ -25,7 +26,6 @@ import { ErrorBoundary } from 'react-error-boundary';
2526
import { useGetOpenAPISchemaQuery } from 'services/api/endpoints/appInfo';
2627

2728
import AppErrorBoundaryFallback from './AppErrorBoundaryFallback';
28-
import Destination from './Destination';
2929
import PreselectedImage from './PreselectedImage';
3030

3131
const DEFAULT_CONFIG = {};
@@ -70,6 +70,12 @@ const App = ({ config = DEFAULT_CONFIG, selectedImage, destination }: Props) =>
7070
}
7171
}, [dispatch, config, logger]);
7272

73+
useEffect(() => {
74+
if (destination) {
75+
dispatch(setActiveTab(destination));
76+
}
77+
}, [dispatch, destination]);
78+
7379
useEffect(() => {
7480
dispatch(appStarted());
7581
}, [dispatch]);
@@ -99,7 +105,6 @@ const App = ({ config = DEFAULT_CONFIG, selectedImage, destination }: Props) =>
99105
<ChangeBoardModal />
100106
<DynamicPromptsModal />
101107
<PreselectedImage selectedImage={selectedImage} />
102-
<Destination destination={destination} />
103108
</ErrorBoundary>
104109
);
105110
};

invokeai/frontend/web/src/app/components/Destination.tsx

Lines changed: 0 additions & 14 deletions
This file was deleted.

invokeai/frontend/web/src/app/components/InvokeAIUI.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import type { PartialAppConfig } from 'app/types/invokeai';
1919
import Loading from 'common/components/Loading/Loading';
2020
import AppDndContext from 'features/dnd/components/AppDndContext';
2121
import type { WorkflowCategory } from 'features/nodes/types/workflow';
22+
import type { InvokeTabName } from 'features/ui/store/tabMap';
2223
import type { PropsWithChildren, ReactNode } from 'react';
2324
import React, { lazy, memo, useEffect, useMemo } from 'react';
2425
import { Provider } from 'react-redux';
@@ -43,7 +44,7 @@ interface Props extends PropsWithChildren {
4344
imageName: string;
4445
action: 'sendToImg2Img' | 'sendToCanvas' | 'useAllParameters';
4546
};
46-
destination?: 'canvas' | 'workflows';
47+
destination?: InvokeTabName;
4748
customStarUi?: CustomStarUi;
4849
socketOptions?: Partial<ManagerOptions & SocketOptions>;
4950
isDebugging?: boolean;

invokeai/frontend/web/src/features/parameters/hooks/useDestination.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)