Skip to content

Commit a32e3f4

Browse files
committed
fix(mobile): show preview only for the tapped option
1 parent b7ee963 commit a32e3f4

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

‎apps/mobile/src/features/threads/PendingUserInputCard.tsx‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,18 +263,15 @@ export function PendingUserInputCard(props: PendingUserInputCardProps) {
263263
>
264264
{props.pendingUserInput.questions.map((question) => {
265265
const draft = props.drafts[question.id];
266-
const selectedPreviewOption = question.options.find((option) => {
266+
const selectedOption = question.options.find((option) => {
267267
const optionValue = option.value ?? option.label.trim();
268268
return (
269269
previewSelection?.questionId === question.id &&
270-
previewSelection.optionValue === optionValue &&
271-
Boolean(option.preview?.trim())
270+
previewSelection.optionValue === optionValue
272271
);
273272
});
274-
const firstOption = question.options[0];
275-
const defaultPreviewOption =
276-
firstOption && Boolean(firstOption.preview?.trim()) ? firstOption : undefined;
277-
const previewOption = selectedPreviewOption ?? defaultPreviewOption;
273+
const previewOption =
274+
selectedOption?.preview?.trim() ? selectedOption : undefined;
278275
const previewText = previewOption?.preview?.trim() ? previewOption.preview : null;
279276
return (
280277
<View key={question.id} className="gap-2 pt-1">

0 commit comments

Comments
 (0)