Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove AI UI if user doesn't have access to AI #9856

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,25 @@ const WholeMeetingSummary = (props: Props) => {
`,
meetingRef
)
const hasAI = window.__ACTION__.hasOpenAI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 This does not work for the email summary

"time":"2024-06-24T12:59:02.466Z","level":"info","message":"ReferenceError: window is not defined\n    at WholeMeetingSummary (/

if (meeting.__typename === 'RetrospectiveMeeting') {
const {summary: wholeMeetingSummary, reflectionGroups, organization} = meeting
const reflections = reflectionGroups?.flatMap((group) => group.reflections) // reflectionCount hasn't been calculated yet so check reflections length
const hasMoreThanOneReflection = reflections?.length && reflections.length > 1
if (!hasMoreThanOneReflection || organization.featureFlags.noAISummary) return null
if (!hasMoreThanOneReflection || organization.featureFlags.noAISummary || !hasAI) return null
if (!wholeMeetingSummary) return <WholeMeetingSummaryLoading />
return <WholeMeetingSummaryResult meetingRef={meeting} />
} else if (meeting.__typename === 'TeamPromptMeeting') {
const {summary: wholeMeetingSummary, responses, organization} = meeting
if (!organization.featureFlags.standupAISummary || organization.featureFlags.noAISummary) {
if (
!organization.featureFlags.standupAISummary ||
organization.featureFlags.noAISummary ||
!hasAI ||
!responses ||
responses.length === 0
) {
return null
}
if (!responses || responses.length === 0) return null
if (!wholeMeetingSummary) return <WholeMeetingSummaryLoading />
return <WholeMeetingSummaryResult meetingRef={meeting} />
}
Expand Down
Loading