mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
only GET intermediates if that setting is an option (#5416)
* only GET intermediates if that setting is an option * lint --------- Co-authored-by: Mary Hipp <maryhipp@Marys-MacBook-Air.local>
This commit is contained in:
parent
cb7e56a9a3
commit
12e9f17f7a
@ -37,11 +37,10 @@ import { SettingsLanguageSelect } from './SettingsLanguageSelect';
|
|||||||
import { SettingsLogLevelSelect } from './SettingsLogLevelSelect';
|
import { SettingsLogLevelSelect } from './SettingsLogLevelSelect';
|
||||||
|
|
||||||
type ConfigOptions = {
|
type ConfigOptions = {
|
||||||
shouldShowDeveloperSettings: boolean;
|
shouldShowDeveloperSettings?: boolean;
|
||||||
shouldShowResetWebUiText: boolean;
|
shouldShowResetWebUiText?: boolean;
|
||||||
shouldShowAdvancedOptionsSettings: boolean;
|
shouldShowClearIntermediates?: boolean;
|
||||||
shouldShowClearIntermediates: boolean;
|
shouldShowLocalizationToggle?: boolean;
|
||||||
shouldShowLocalizationToggle: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type SettingsModalProps = {
|
type SettingsModalProps = {
|
||||||
@ -84,7 +83,7 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
|
|||||||
hasPendingItems,
|
hasPendingItems,
|
||||||
intermediatesCount,
|
intermediatesCount,
|
||||||
isLoading: isLoadingClearIntermediates,
|
isLoading: isLoadingClearIntermediates,
|
||||||
} = useClearIntermediates();
|
} = useClearIntermediates(shouldShowClearIntermediates);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
isOpen: isSettingsModalOpen,
|
isOpen: isSettingsModalOpen,
|
||||||
|
@ -17,7 +17,9 @@ export type UseClearIntermediatesReturn = {
|
|||||||
hasPendingItems: boolean;
|
hasPendingItems: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useClearIntermediates = (): UseClearIntermediatesReturn => {
|
export const useClearIntermediates = (
|
||||||
|
shouldShowClearIntermediates: boolean
|
||||||
|
): UseClearIntermediatesReturn => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
@ -25,6 +27,7 @@ export const useClearIntermediates = (): UseClearIntermediatesReturn => {
|
|||||||
undefined,
|
undefined,
|
||||||
{
|
{
|
||||||
refetchOnMountOrArgChange: true,
|
refetchOnMountOrArgChange: true,
|
||||||
|
skip: !shouldShowClearIntermediates,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user