mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
reset on unmount
This commit is contained in:
parent
56be24b0e4
commit
6233b0d70d
@ -29,14 +29,12 @@ interface Props {
|
|||||||
imageName: string;
|
imageName: string;
|
||||||
action: 'sendToImg2Img' | 'sendToCanvas' | 'useAllParameters';
|
action: 'sendToImg2Img' | 'sendToCanvas' | 'useAllParameters';
|
||||||
};
|
};
|
||||||
projectId?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const App = ({
|
const App = ({
|
||||||
config = DEFAULT_CONFIG,
|
config = DEFAULT_CONFIG,
|
||||||
headerComponent,
|
headerComponent,
|
||||||
selectedImage,
|
selectedImage,
|
||||||
projectId,
|
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const language = useAppSelector(languageSelector);
|
const language = useAppSelector(languageSelector);
|
||||||
|
|
||||||
@ -53,12 +51,6 @@ const App = ({
|
|||||||
i18n.changeLanguage(language);
|
i18n.changeLanguage(language);
|
||||||
}, [language]);
|
}, [language]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (projectId) {
|
|
||||||
dispatch(api.util.resetApiState());
|
|
||||||
}
|
|
||||||
}, [projectId, dispatch]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (size(config)) {
|
if (size(config)) {
|
||||||
logger.info({ config }, 'Received config');
|
logger.info({ config }, 'Received config');
|
||||||
@ -74,6 +66,12 @@ dispatch(api.util.resetApiState());
|
|||||||
handlePreselectedImage(selectedImage);
|
handlePreselectedImage(selectedImage);
|
||||||
}, [handlePreselectedImage, selectedImage]);
|
}, [handlePreselectedImage, selectedImage]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
return () => {
|
||||||
|
dispatch(api.util.resetApiState());
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ErrorBoundary
|
<ErrorBoundary
|
||||||
onReset={handleReset}
|
onReset={handleReset}
|
||||||
|
@ -90,7 +90,6 @@ const InvokeAIUI = ({
|
|||||||
config={config}
|
config={config}
|
||||||
headerComponent={headerComponent}
|
headerComponent={headerComponent}
|
||||||
selectedImage={selectedImage}
|
selectedImage={selectedImage}
|
||||||
projectId={projectId}
|
|
||||||
/>
|
/>
|
||||||
</AppDndContext>
|
</AppDndContext>
|
||||||
</ThemeLocaleProvider>
|
</ThemeLocaleProvider>
|
||||||
|
Loading…
Reference in New Issue
Block a user