Skip to content

Commit

Permalink
fix: hide ai icebreaker ui for non ai users (#9824)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickoferrall authored Jun 11, 2024
1 parent 6aec87f commit 6cf4098
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const QuestionBlock = styled('div')({
}
}
})

interface Props {
meeting: NewCheckInQuestion_meeting$key
}
Expand Down Expand Up @@ -227,7 +228,8 @@ const NewCheckInQuestion = (props: Props) => {
}
})
}
const hideAiIcebreaker = featureFlags.noAISummary || !isFacilitating
const showAiIcebreaker =
!featureFlags.noAISummary && isFacilitating && window.__ACTION__.hasOpenAI

return (
<>
Expand Down Expand Up @@ -269,7 +271,7 @@ const NewCheckInQuestion = (props: Props) => {
</div>
)}
</QuestionBlock>
{!hideAiIcebreaker && (
{showAiIcebreaker && (
<div className='flex flex-col gap-4 rounded-lg bg-slate-100 p-6'>
<div className='flex flex-col items-center justify-center gap-2'>
<div className='inline-flex gap-2'>
Expand Down
1 change: 1 addition & 0 deletions packages/client/types/modules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ interface Window {
slack: string
stripe: string
oauth2Redirect: string
hasOpenAI: boolean
prblIn: string | undefined
AUTH_INTERNAL_ENABLED: boolean
AUTH_GOOGLE_ENABLED: boolean
Expand Down
1 change: 1 addition & 0 deletions scripts/toolboxSrc/applyEnvVarsToClientAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const rewriteIndexHTML = () => {
stripe: process.env.STRIPE_PUBLISHABLE_KEY,
publicPath: __webpack_public_path__,
oauth2Redirect: process.env.OAUTH2_REDIRECT,
hasOpenAI: !!process.env.OPEN_AI_API_KEY,
prblIn: process.env.INVITATION_SHORTLINK,
AUTH_INTERNAL_ENABLED: process.env.AUTH_INTERNAL_DISABLED !== 'true',
AUTH_GOOGLE_ENABLED: process.env.AUTH_GOOGLE_DISABLED !== 'true',
Expand Down
1 change: 1 addition & 0 deletions scripts/webpack/dev.client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ module.exports = {
slack: process.env.SLACK_CLIENT_ID,
stripe: process.env.STRIPE_PUBLISHABLE_KEY,
oauth2Redirect: process.env.OAUTH2_REDIRECT,
hasOpenAI: !!process.env.OPEN_AI_API_KEY,
prblIn: process.env.INVITATION_SHORTLINK,
AUTH_INTERNAL_ENABLED: process.env.AUTH_INTERNAL_DISABLED !== 'true',
AUTH_GOOGLE_ENABLED: process.env.AUTH_GOOGLE_DISABLED !== 'true',
Expand Down

0 comments on commit 6cf4098

Please sign in to comment.