Skip to content

Commit 36238c0

Browse files
authored
fix: show thread when submitting new answer (#766)
1 parent 090b778 commit 36238c0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/modules/responseCollection/ResponseInput.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { useThreadsContext } from '@/state/ThreadsContext';
1515
import useParticipants from '@/state/useParticipants';
1616

1717
import Loader from '../common/Loader';
18+
import Thread from '../common/response/Thread';
1819
import { useSettings } from '../context/SettingsContext';
1920
import MarkdownEditor from './MarkdownEditor';
2021
import Prompts from './prompts/Prompts';
@@ -38,10 +39,12 @@ const ResponseInput: FC<{
3839
});
3940
const { instructions } = useSettings();
4041
const { t: generalT } = useTranslation('translations');
41-
const { postResponse } = useThreadsContext();
42+
const { postResponse, allThreads } = useThreadsContext();
4243
const { me: myselfAsParticipant } = useParticipants();
4344
const me = participantToAuthor(myselfAsParticipant);
4445

46+
const thread = allThreads?.find((tt) => tt.id === threadId);
47+
4548
const [response, setResponse] = useState<string>('');
4649

4750
const [isPosting, setIsPosting] = useState(false);
@@ -82,6 +85,7 @@ const ResponseInput: FC<{
8285
<Alert severity="info">{inputInstructions.content}</Alert>
8386
)}
8487
<Prompts onChange={(p) => setGivenPrompt(p)} />
88+
{thread && <Thread thread={thread} />}
8589
<Paper
8690
variant="outlined"
8791
sx={{ width: { md: '75ch', sm: '100%' }, maxWidth: '100%' }}

0 commit comments

Comments
 (0)