Skip to content

Commit

Permalink
Guard BotController with schema check (#5200)
Browse files Browse the repository at this point in the history
Co-authored-by: Srinaath Ravichandran <srinaath27@gmail.com>
  • Loading branch information
cwhitten and srinaath authored Dec 8, 2020
1 parent e0d3dbe commit 8bdfc4a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Composer/packages/client/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import { IconButton, IButtonStyles } from 'office-ui-fabric-react/lib/Button';
import { TeachingBubble } from 'office-ui-fabric-react/lib/TeachingBubble';
import { DirectionalHint } from 'office-ui-fabric-react/lib/Callout';
import { Dropdown, IDropdownOption } from 'office-ui-fabric-react/lib/Dropdown';
import { checkForPVASchema } from '@bfc/shared';
import { useCallback, useState, Fragment, useMemo, useEffect } from 'react';
import { NeutralColors, SharedColors, FontSizes, CommunicationColors } from '@uifabric/fluent-theme';
import { useRecoilValue } from 'recoil';
import { FontWeights } from 'office-ui-fabric-react/lib/Styling';

import { schemasState } from '../recoilModel/atoms';
import {
dispatcherState,
appUpdateState,
Expand Down Expand Up @@ -135,6 +137,7 @@ export const Header = () => {
const appUpdate = useRecoilValue(appUpdateState);
const [teachingBubbleVisibility, setTeachingBubbleVisibility] = useState<boolean>();
const settings = useRecoilValue(settingsState(projectId));
const schemas = useRecoilValue(schemasState(projectId));

const { languages, defaultLanguage } = settings;
const { showing, status } = appUpdate;
Expand Down Expand Up @@ -202,7 +205,7 @@ export const Header = () => {
</div>

<div css={rightSection}>
{showStartBotsWidget && <BotController />}
{showStartBotsWidget && !checkForPVASchema(schemas.sdk) && <BotController />}
{showUpdateAvailableIcon && (
<IconButton
iconProps={{ iconName: 'History' }}
Expand Down

0 comments on commit 8bdfc4a

Please sign in to comment.