only refetch intermediates on modal open if it is enabled

This commit is contained in:
Mary Hipp 2024-02-13 12:29:38 -05:00 committed by psychedelicious
parent 3726293258
commit 85bbf65967

View File

@ -101,9 +101,11 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
const clearStorage = useClearStorage(); const clearStorage = useClearStorage();
const handleOpenSettingsModel = useCallback(() => { const handleOpenSettingsModel = useCallback(() => {
refetchIntermediatesCount(); if (shouldShowClearIntermediates) {
refetchIntermediatesCount();
}
_onSettingsModalOpen(); _onSettingsModalOpen();
}, [_onSettingsModalOpen, refetchIntermediatesCount]); }, [_onSettingsModalOpen, refetchIntermediatesCount, shouldShowClearIntermediates]);
const handleClickResetWebUI = useCallback(() => { const handleClickResetWebUI = useCallback(() => {
clearStorage(); clearStorage();