Skip to content

Commit 26d752b

Browse files
authored
fix: disable 'ask bot' button (#64)
1 parent f8adc62 commit 26d752b

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/modules/responseCollection/ResponseInput.tsx

+15-8
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ const ResponseInput: FC<{
3131
parent?: AnonymousResponseData;
3232
onSubmitted?: (id: string) => void;
3333
actAsBot?: boolean;
34-
}> = ({ parent, currentRound, onSubmitted, actAsBot }) => {
34+
enableAssistants?: boolean;
35+
}> = (
36+
{ parent, currentRound, onSubmitted, actAsBot, enableAssistants } = {
37+
enableAssistants: false,
38+
},
39+
) => {
3540
const { t } = useTranslation();
3641
const { postResponse } = useActivityContext();
3742
const [isWaitingOnBot, setIsWaitingOnBot] = useState<boolean>(false);
@@ -127,13 +132,15 @@ const ResponseInput: FC<{
127132
>
128133
{t('SUBMIT')}
129134
</Button>
130-
<LoadingButton
131-
loadingIndicator="Waiting for the bot to reply."
132-
loading={isWaitingOnBot}
133-
onClick={askBot}
134-
>
135-
Ask the bot
136-
</LoadingButton>
135+
{enableAssistants && (
136+
<LoadingButton
137+
loadingIndicator="Waiting for the bot to reply."
138+
loading={isWaitingOnBot}
139+
onClick={askBot}
140+
>
141+
Ask the bot
142+
</LoadingButton>
143+
)}
137144
<Collapse in={isPosting}>
138145
<Stack direction="row" spacing={1}>
139146
<Alert severity="info">{t('IDEA_BEING_SUBMITTED_ALERT')}</Alert>

0 commit comments

Comments
 (0)