mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): show collapse labels only if not default value
This commit is contained in:
parent
94055ae54a
commit
6c66adcd90
@ -16,15 +16,13 @@ const ParamDynamicPromptsCollapse = () => {
|
||||
() =>
|
||||
createSelector(stateSelector, ({ dynamicPrompts }) => {
|
||||
const count = dynamicPrompts.prompts.length;
|
||||
if (count === 1) {
|
||||
return t('dynamicPrompts.promptsWithCount_one', {
|
||||
count,
|
||||
});
|
||||
} else {
|
||||
if (count > 1) {
|
||||
return t('dynamicPrompts.promptsWithCount_other', {
|
||||
count,
|
||||
});
|
||||
}
|
||||
|
||||
return;
|
||||
}),
|
||||
[t]
|
||||
);
|
||||
|
@ -28,9 +28,7 @@ export default function ParamAdvancedCollapse() {
|
||||
const activeLabel = useMemo(() => {
|
||||
const activeLabel: string[] = [];
|
||||
|
||||
if (shouldUseCpuNoise) {
|
||||
activeLabel.push(t('parameters.cpuNoise'));
|
||||
} else {
|
||||
if (!shouldUseCpuNoise) {
|
||||
activeLabel.push(t('parameters.gpuNoise'));
|
||||
}
|
||||
|
||||
|
@ -4,12 +4,13 @@ import { RootState, stateSelector } from 'app/store/store';
|
||||
import { useAppSelector } from 'app/store/storeHooks';
|
||||
import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
|
||||
import IAICollapse from 'common/components/IAICollapse';
|
||||
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
|
||||
import { useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import ParamHrfHeight from './ParamHrfHeight';
|
||||
import ParamHrfStrength from './ParamHrfStrength';
|
||||
import ParamHrfToggle from './ParamHrfToggle';
|
||||
import ParamHrfWidth from './ParamHrfWidth';
|
||||
import ParamHrfHeight from './ParamHrfHeight';
|
||||
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
|
||||
|
||||
const selector = createSelector(
|
||||
stateSelector,
|
||||
@ -22,15 +23,14 @@ const selector = createSelector(
|
||||
);
|
||||
|
||||
export default function ParamHrfCollapse() {
|
||||
const { t } = useTranslation();
|
||||
const isHRFFeatureEnabled = useFeatureStatus('hrf').isFeatureEnabled;
|
||||
const { hrfEnabled } = useAppSelector(selector);
|
||||
const activeLabel = useMemo(() => {
|
||||
if (hrfEnabled) {
|
||||
return 'On';
|
||||
} else {
|
||||
return 'Off';
|
||||
return t('common.on');
|
||||
}
|
||||
}, [hrfEnabled]);
|
||||
}, [t, hrfEnabled]);
|
||||
|
||||
if (!isHRFFeatureEnabled) {
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user