fix preselected image (#5185)

* fix for new response shape

* unused import

---------

Co-authored-by: Mary Hipp <maryhipp@Marys-MacBook-Air.local>
This commit is contained in:
Mary Hipp Rogers 2023-11-28 09:24:54 -05:00 committed by GitHub
parent ace0eb366b
commit 4eca802cdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,4 @@
import { skipToken } from '@reduxjs/toolkit/dist/query';
import { CoreMetadata } from 'features/nodes/types/types';
import { t } from 'i18next';
import { useCallback, useEffect } from 'react';
import { useAppToaster } from '../../../app/components/Toaster';
@ -51,7 +50,7 @@ export const usePreselectedImage = (selectedImage?: {
const handleUseAllMetadata = useCallback(() => {
if (selectedImageMetadata) {
recallAllParameters(selectedImageMetadata.metadata as CoreMetadata);
recallAllParameters(selectedImageMetadata);
}
// disabled because `recallAllParameters` changes the model, but its dep to prepare LoRAs has model as a dep. this introduces circular logic that causes infinite re-renders
// eslint-disable-next-line react-hooks/exhaustive-deps