mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix: Clean up merge models submit handler
This commit is contained in:
parent
2a533b275f
commit
3c7cf72423
@ -43,8 +43,7 @@ export default function MergeModelsPanel() {
|
||||
|
||||
const { data } = useGetMainModelsQuery();
|
||||
|
||||
const [mergeModels, { isLoading, error, data: mergedModelData }] =
|
||||
useMergeMainModelsMutation();
|
||||
const [mergeModels, { isLoading }] = useMergeMainModelsMutation();
|
||||
|
||||
const [baseModel, setBaseModel] = useState<BaseModelType>('sd-1');
|
||||
|
||||
@ -134,8 +133,19 @@ export default function MergeModelsPanel() {
|
||||
mergeModels({
|
||||
base_model: baseModel,
|
||||
body: mergeModelsInfo,
|
||||
});
|
||||
|
||||
})
|
||||
.unwrap()
|
||||
.then((_) => {
|
||||
dispatch(
|
||||
addToast(
|
||||
makeToast({
|
||||
title: t('modelManager.modelsMerged'),
|
||||
status: 'success',
|
||||
})
|
||||
)
|
||||
);
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error) {
|
||||
dispatch(
|
||||
addToast(
|
||||
@ -146,17 +156,7 @@ export default function MergeModelsPanel() {
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (mergedModelData) {
|
||||
dispatch(
|
||||
addToast(
|
||||
makeToast({
|
||||
title: t('modelManager.modelsMerged'),
|
||||
status: 'success',
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
|
@ -9,7 +9,7 @@ import { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { useConvertMainModelsMutation } from 'services/api/endpoints/models';
|
||||
import { CheckpointModelConfig } from './CheckpointModelEdit';
|
||||
import { CheckpointModelConfig } from 'services/api/types';
|
||||
|
||||
interface ModelConvertProps {
|
||||
model: CheckpointModelConfig;
|
||||
@ -21,8 +21,7 @@ export default function ModelConvert(props: ModelConvertProps) {
|
||||
const dispatch = useAppDispatch();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [convertModel, { isLoading, error, data }] =
|
||||
useConvertMainModelsMutation();
|
||||
const [convertModel, { isLoading }] = useConvertMainModelsMutation();
|
||||
|
||||
const [saveLocation, setSaveLocation] = useState<string>('same');
|
||||
const [customSaveLocation, setCustomSaveLocation] = useState<string>('');
|
||||
@ -42,7 +41,7 @@ export default function ModelConvert(props: ModelConvertProps) {
|
||||
};
|
||||
convertModel(responseBody)
|
||||
.unwrap()
|
||||
.then((payload) => {
|
||||
.then((_) => {
|
||||
dispatch(
|
||||
addToast(
|
||||
makeToast({
|
||||
@ -52,7 +51,7 @@ export default function ModelConvert(props: ModelConvertProps) {
|
||||
)
|
||||
);
|
||||
})
|
||||
.catch((error) => {
|
||||
.catch((_) => {
|
||||
dispatch(
|
||||
addToast(
|
||||
makeToast({
|
||||
|
Loading…
Reference in New Issue
Block a user