Skip to content

Commit 9170576

Browse files
Mary Hippmaryhipp
Mary Hipp
authored andcommitted
make logic more straight forward
1 parent f26baa0 commit 9170576

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

invokeai/frontend/web/src/features/parameters/components/MainModel/DisabledModelWarning.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const DisabledModelWarning = () => {
1111
const model = useAppSelector(selectModel);
1212

1313
const accountSettingsLink = useStore($accountSettingsLink);
14-
const isChatGPT4oHighModelDisabled = useIsModelDisabled('chatGPT4oHigh');
14+
const { isChatGPT4oHighModelDisabled } = useIsModelDisabled();
1515

1616
if (!model || !isChatGPT4oHighModelDisabled(model)) {
1717
return null;
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
import type { AppFeature } from 'app/types/invokeai';
21
import type { ParameterModel } from 'features/parameters/types/parameterSchemas';
32
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
43
import { useCallback } from 'react';
54

6-
export const useIsModelDisabled = (feature: AppFeature) => {
7-
const isEnabled = useFeatureStatus(feature);
5+
export const useIsModelDisabled = () => {
6+
const isChatGPT4oHighEnabled = useFeatureStatus('chatGPT4oHigh');
87

9-
const isModelDisabled = useCallback(
8+
const isChatGPT4oHighModelDisabled = useCallback(
109
(model: ParameterModel) => {
11-
return model?.base === 'chatgpt-4o' && model.name.toLowerCase().includes('high') && !isEnabled;
10+
return model?.base === 'chatgpt-4o' && model.name.toLowerCase().includes('high') && !isChatGPT4oHighEnabled;
1211
},
13-
[isEnabled]
12+
[isChatGPT4oHighEnabled]
1413
);
1514

16-
return isModelDisabled;
15+
return { isChatGPT4oHighModelDisabled };
1716
};

invokeai/frontend/web/src/features/queue/store/readiness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export const useReadinessWatcher = () => {
153153
const canvasIsSelectingObject = useStore(canvasManager?.stateApi.$isSegmenting ?? $true);
154154
const canvasIsCompositing = useStore(canvasManager?.compositor.$isBusy ?? $true);
155155
const isInPublishFlow = useStore($isInPublishFlow);
156-
const isChatGPT4oHighModelDisabled = useIsModelDisabled('chatGPT4oHigh');
156+
const { isChatGPT4oHighModelDisabled } = useIsModelDisabled();
157157

158158
useEffect(() => {
159159
debouncedUpdateReasons(

0 commit comments

Comments
 (0)