mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
prop to hide toggle for advanced settings
This commit is contained in:
parent
bdbdcabcdf
commit
3dc42869f4
@ -90,6 +90,7 @@ type ConfigOptions = {
|
|||||||
shouldShowDeveloperSettings: boolean;
|
shouldShowDeveloperSettings: boolean;
|
||||||
shouldShowResetWebUiText: boolean;
|
shouldShowResetWebUiText: boolean;
|
||||||
shouldShowBetaLayout: boolean;
|
shouldShowBetaLayout: boolean;
|
||||||
|
shouldShowAdvancedOptionsSettings: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type SettingsModalProps = {
|
type SettingsModalProps = {
|
||||||
@ -106,6 +107,8 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
|
|||||||
const shouldShowDeveloperSettings =
|
const shouldShowDeveloperSettings =
|
||||||
config?.shouldShowDeveloperSettings ?? true;
|
config?.shouldShowDeveloperSettings ?? true;
|
||||||
const shouldShowResetWebUiText = config?.shouldShowResetWebUiText ?? true;
|
const shouldShowResetWebUiText = config?.shouldShowResetWebUiText ?? true;
|
||||||
|
const shouldShowAdvancedOptionsSettings =
|
||||||
|
config?.shouldShowAdvancedOptionsSettings ?? true;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!shouldShowDeveloperSettings) {
|
if (!shouldShowDeveloperSettings) {
|
||||||
@ -193,13 +196,15 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
|
|||||||
dispatch(setShouldConfirmOnDelete(e.target.checked))
|
dispatch(setShouldConfirmOnDelete(e.target.checked))
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<IAISwitch
|
{shouldShowAdvancedOptionsSettings && (
|
||||||
label={t('settings.showAdvancedOptions')}
|
<IAISwitch
|
||||||
isChecked={shouldShowAdvancedOptions}
|
label={t('settings.showAdvancedOptions')}
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
isChecked={shouldShowAdvancedOptions}
|
||||||
dispatch(setShouldShowAdvancedOptions(e.target.checked))
|
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||||
}
|
dispatch(setShouldShowAdvancedOptions(e.target.checked))
|
||||||
/>
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</StyledFlex>
|
</StyledFlex>
|
||||||
|
|
||||||
<StyledFlex>
|
<StyledFlex>
|
||||||
|
Loading…
Reference in New Issue
Block a user