mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-16 13:25:12 -05:00
fix(ui): tidy remaining selectors
These were just using overly verbose syntax - like explicitly typing `state: RootState`, which is unnecessary.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { Flex } from '@chakra-ui/react';
|
||||
import type { RootState } from 'app/store/store';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import { InvButton } from 'common/components/InvButton/InvButton';
|
||||
import { InvControl } from 'common/components/InvControl/InvControl';
|
||||
@@ -22,9 +21,7 @@ import {
|
||||
} from 'services/api/endpoints/models';
|
||||
|
||||
const FoundModelsList = () => {
|
||||
const searchFolder = useAppSelector(
|
||||
(state: RootState) => state.modelmanager.searchFolder
|
||||
);
|
||||
const searchFolder = useAppSelector((s) => s.modelmanager.searchFolder);
|
||||
const [nameFilter, setNameFilter] = useState<string>('');
|
||||
|
||||
// Get paths of models that are already installed
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Box, Flex } from '@chakra-ui/react';
|
||||
import type { RootState } from 'app/store/store';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import { InvControl } from 'common/components/InvControl/InvControl';
|
||||
import { InvIconButton } from 'common/components/InvIconButton/InvIconButton';
|
||||
@@ -21,7 +20,7 @@ import { isManualAddMode } from './AdvancedAddModels';
|
||||
|
||||
const ScanAdvancedAddModels = () => {
|
||||
const advancedAddScanModel = useAppSelector(
|
||||
(state: RootState) => state.modelmanager.advancedAddScanModel
|
||||
(s) => s.modelmanager.advancedAddScanModel
|
||||
);
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Flex } from '@chakra-ui/react';
|
||||
import { useForm } from '@mantine/form';
|
||||
import type { RootState } from 'app/store/store';
|
||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||
import { InvIconButton } from 'common/components/InvIconButton/InvIconButton';
|
||||
import { InvInput } from 'common/components/InvInput/InvInput';
|
||||
@@ -23,9 +22,7 @@ function SearchFolderForm() {
|
||||
const dispatch = useAppDispatch();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const searchFolder = useAppSelector(
|
||||
(state: RootState) => state.modelmanager.searchFolder
|
||||
);
|
||||
const searchFolder = useAppSelector((s) => s.modelmanager.searchFolder);
|
||||
|
||||
const { refetch: refetchFoundModels } = useGetModelsInFolderQuery({
|
||||
search_path: searchFolder ? searchFolder : '',
|
||||
|
||||
Reference in New Issue
Block a user