Skip to content

Commit

Permalink
fix: fix condition for signout (Issue #627)(#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikitabut authored Jan 31, 2024
1 parent 71baef8 commit 3d77f3b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/store/models/models.epics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { combineEpics } from 'redux-observable';

import { DataService } from '@/src/utils/app/data/data-service';

import { Feature } from '@/src/types/features';
import { OpenAIEntityModel } from '@/src/types/openai';
import { AppEpic } from '@/src/types/store';

Expand Down Expand Up @@ -88,7 +89,12 @@ const getModelsEpic: AppEpic = (action$, state$) =>
return from(resp.json());
}),
map((response: OpenAIEntityModel[]) => {
if (response.length === 0) {
const isOverlay = SettingsSelectors.selectIsOverlay(state$.value);
const isHeaderFeatureEnabled = SettingsSelectors.isFeatureEnabled(
state$.value,
Feature.Header,
);
if (response.length === 0 && isOverlay && isHeaderFeatureEnabled) {
signOut();
}
return ModelsActions.getModelsSuccess({ models: response });
Expand Down

0 comments on commit 3d77f3b

Please sign in to comment.