mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
set default for informational popups to be disabled
This commit is contained in:
parent
b64ade586d
commit
21de74fac4
@ -32,15 +32,15 @@ function IAIInformationalPopover({
|
||||
children,
|
||||
placement,
|
||||
}: Props): JSX.Element {
|
||||
const shouldDisableInformationalPopovers = useAppSelector(
|
||||
(state) => state.system.shouldDisableInformationalPopovers
|
||||
const shouldEnableInformationalPopovers = useAppSelector(
|
||||
(state) => state.system.shouldEnableInformationalPopovers
|
||||
);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const heading = t(`popovers.${details}.heading`);
|
||||
const paragraph = t(`popovers.${details}.paragraph`);
|
||||
|
||||
if (shouldDisableInformationalPopovers) {
|
||||
if (!shouldEnableInformationalPopovers) {
|
||||
return children;
|
||||
} else {
|
||||
return (
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Flex, Spacer, Text } from '@chakra-ui/react';
|
||||
import { Box, Flex, Spacer, Text } from '@chakra-ui/react';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import IAIIconButton from 'common/components/IAIIconButton';
|
||||
@ -94,20 +94,22 @@ export default function ParamBoundingBoxSize() {
|
||||
}}
|
||||
>
|
||||
<Flex alignItems="center" gap={2}>
|
||||
<IAIInformationalPopover details="paramRatio">
|
||||
<Text
|
||||
sx={{
|
||||
fontSize: 'sm',
|
||||
width: 'full',
|
||||
color: 'base.700',
|
||||
_dark: {
|
||||
color: 'base.300',
|
||||
},
|
||||
}}
|
||||
>
|
||||
{t('parameters.aspectRatio')}
|
||||
</Text>
|
||||
</IAIInformationalPopover>
|
||||
<Box width="full">
|
||||
<IAIInformationalPopover details="paramRatio">
|
||||
<Text
|
||||
sx={{
|
||||
fontSize: 'sm',
|
||||
width: 'full',
|
||||
color: 'base.700',
|
||||
_dark: {
|
||||
color: 'base.300',
|
||||
},
|
||||
}}
|
||||
>
|
||||
{t('parameters.aspectRatio')}
|
||||
</Text>
|
||||
</IAIInformationalPopover>
|
||||
</Box>
|
||||
<Spacer />
|
||||
<ParamAspectRatio />
|
||||
<IAIIconButton
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Flex, Spacer, Text } from '@chakra-ui/react';
|
||||
import { Box, Flex, Spacer, Text } from '@chakra-ui/react';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import IAIIconButton from 'common/components/IAIIconButton';
|
||||
@ -84,20 +84,21 @@ export default function ParamSize() {
|
||||
}}
|
||||
>
|
||||
<Flex alignItems="center" gap={2}>
|
||||
<IAIInformationalPopover details="paramRatio">
|
||||
<Text
|
||||
sx={{
|
||||
fontSize: 'sm',
|
||||
width: 'full',
|
||||
color: 'base.700',
|
||||
_dark: {
|
||||
color: 'base.300',
|
||||
},
|
||||
}}
|
||||
>
|
||||
{t('parameters.aspectRatio')}
|
||||
</Text>
|
||||
</IAIInformationalPopover>
|
||||
<Box width="full">
|
||||
<IAIInformationalPopover details="paramRatio">
|
||||
<Text
|
||||
sx={{
|
||||
fontSize: 'sm',
|
||||
color: 'base.700',
|
||||
_dark: {
|
||||
color: 'base.300',
|
||||
},
|
||||
}}
|
||||
>
|
||||
{t('parameters.aspectRatio')}
|
||||
</Text>
|
||||
</IAIInformationalPopover>
|
||||
</Box>
|
||||
<Spacer />
|
||||
<ParamAspectRatio />
|
||||
<IAIIconButton
|
||||
|
@ -23,7 +23,7 @@ import {
|
||||
consoleLogLevelChanged,
|
||||
setEnableImageDebugging,
|
||||
setShouldConfirmOnDelete,
|
||||
setShouldDisableInformationalPopovers,
|
||||
setShouldEnableInformationalPopovers,
|
||||
shouldAntialiasProgressImageChanged,
|
||||
shouldLogToConsoleChanged,
|
||||
shouldUseNSFWCheckerChanged,
|
||||
@ -67,7 +67,7 @@ const selector = createSelector(
|
||||
shouldAntialiasProgressImage,
|
||||
shouldUseNSFWChecker,
|
||||
shouldUseWatermarker,
|
||||
shouldDisableInformationalPopovers,
|
||||
shouldEnableInformationalPopovers,
|
||||
} = system;
|
||||
|
||||
const {
|
||||
@ -87,7 +87,7 @@ const selector = createSelector(
|
||||
shouldUseNSFWChecker,
|
||||
shouldUseWatermarker,
|
||||
shouldAutoChangeDimensions,
|
||||
shouldDisableInformationalPopovers,
|
||||
shouldEnableInformationalPopovers,
|
||||
};
|
||||
},
|
||||
{
|
||||
@ -161,7 +161,7 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
|
||||
shouldUseNSFWChecker,
|
||||
shouldUseWatermarker,
|
||||
shouldAutoChangeDimensions,
|
||||
shouldDisableInformationalPopovers,
|
||||
shouldEnableInformationalPopovers,
|
||||
} = useAppSelector(selector);
|
||||
|
||||
const handleClickResetWebUI = useCallback(() => {
|
||||
@ -312,11 +312,11 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
|
||||
/>
|
||||
)}
|
||||
<SettingSwitch
|
||||
label="Disable informational popovers"
|
||||
isChecked={shouldDisableInformationalPopovers}
|
||||
label="Enable informational popovers"
|
||||
isChecked={shouldEnableInformationalPopovers}
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
dispatch(
|
||||
setShouldDisableInformationalPopovers(e.target.checked)
|
||||
setShouldEnableInformationalPopovers(e.target.checked)
|
||||
)
|
||||
}
|
||||
/>
|
||||
|
@ -35,7 +35,7 @@ export const initialSystemState: SystemState = {
|
||||
language: 'en',
|
||||
shouldUseNSFWChecker: false,
|
||||
shouldUseWatermarker: false,
|
||||
shouldDisableInformationalPopovers: false,
|
||||
shouldEnableInformationalPopovers: false,
|
||||
status: 'DISCONNECTED',
|
||||
};
|
||||
|
||||
@ -76,11 +76,11 @@ export const systemSlice = createSlice({
|
||||
shouldUseWatermarkerChanged(state, action: PayloadAction<boolean>) {
|
||||
state.shouldUseWatermarker = action.payload;
|
||||
},
|
||||
setShouldDisableInformationalPopovers(
|
||||
setShouldEnableInformationalPopovers(
|
||||
state,
|
||||
action: PayloadAction<boolean>
|
||||
) {
|
||||
state.shouldDisableInformationalPopovers = action.payload;
|
||||
state.shouldEnableInformationalPopovers = action.payload;
|
||||
},
|
||||
},
|
||||
extraReducers(builder) {
|
||||
@ -241,7 +241,7 @@ export const {
|
||||
languageChanged,
|
||||
shouldUseNSFWCheckerChanged,
|
||||
shouldUseWatermarkerChanged,
|
||||
setShouldDisableInformationalPopovers,
|
||||
setShouldEnableInformationalPopovers,
|
||||
} = systemSlice.actions;
|
||||
|
||||
export default systemSlice.reducer;
|
||||
|
@ -33,7 +33,7 @@ export interface SystemState {
|
||||
shouldUseNSFWChecker: boolean;
|
||||
shouldUseWatermarker: boolean;
|
||||
status: SystemStatus;
|
||||
shouldDisableInformationalPopovers: boolean;
|
||||
shouldEnableInformationalPopovers: boolean;
|
||||
}
|
||||
|
||||
export const LANGUAGES = {
|
||||
|
Loading…
Reference in New Issue
Block a user