add option to disable model syncing in UI

This commit is contained in:
Mary Hipp
2023-07-25 14:48:12 -04:00
committed by psychedelicious
parent 7d337dccc2
commit 7f5a89f567
3 changed files with 16 additions and 7 deletions

View File

@ -15,6 +15,7 @@ import { modelIdToMainModelParam } from 'features/parameters/util/modelIdToMainM
import SyncModelsButton from 'features/ui/components/tabs/ModelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton';
import { forEach } from 'lodash-es';
import { useGetMainModelsQuery } from 'services/api/endpoints/models';
import { useFeatureStatus } from '../../../../system/hooks/useFeatureStatus';
const selector = createSelector(
stateSelector,
@ -29,6 +30,7 @@ const ParamMainModelSelect = () => {
const { model } = useAppSelector(selector);
const { data: mainModels, isLoading } = useGetMainModelsQuery();
const isSyncModelEnabled = useFeatureStatus('syncModels').isFeatureEnabled;
const data = useMemo(() => {
if (!mainModels) {
@ -98,9 +100,11 @@ const ParamMainModelSelect = () => {
onChange={handleChangeModel}
w="100%"
/>
<Box mt={7}>
<SyncModelsButton iconMode />
</Box>
{isSyncModelEnabled && (
<Box mt={7}>
<SyncModelsButton iconMode />
</Box>
)}
</Flex>
);
};