Skip to content

Commit dc190b8

Browse files
committed
Preserve initial action
1 parent 28b488b commit dc190b8

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

packages/component/src/Activity/ActivityFeedback.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@ function ActivityFeedback({ activity }: ActivityFeedbackProps) {
6363
try {
6464
const reactActions = (messageThing?.potentialAction || [])
6565
.filter(({ '@type': type }) => type === 'LikeAction' || type === 'DislikeAction')
66-
.map(action => ({
67-
...action,
68-
actionStatus:
69-
action['@type'] === selectedAction?.['@type'] && feedbackSubmitted
70-
? 'CompletedActionStatus'
71-
: action.actionStatus
72-
}));
66+
.map(action =>
67+
action['@type'] === selectedAction?.['@type'] && feedbackSubmitted
68+
? {
69+
...action,
70+
actionStatus: 'CompletedActionStatus' as const
71+
}
72+
: action
73+
);
7374

7475
if (reactActions.length) {
7576
return Object.freeze(new Set(reactActions));

0 commit comments

Comments
 (0)