From cfbe1d19a058ea8c3dd84165550ad992a85d26ef Mon Sep 17 00:00:00 2001 From: James Grugett Date: Mon, 18 Apr 2022 17:58:41 -0500 Subject: [PATCH] Show answer text in market resolve email --- functions/src/emails.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions/src/emails.ts b/functions/src/emails.ts index 14c198cc..143e938d 100644 --- a/functions/src/emails.ts +++ b/functions/src/emails.ts @@ -5,7 +5,7 @@ import { Answer } from '../../common/answer' import { Bet } from '../../common/bet' import { getProbability } from '../../common/calculate' import { Comment } from '../../common/comment' -import { Contract } from '../../common/contract' +import { Contract, FreeResponseContract } from '../../common/contract' import { CREATOR_FEE } from '../../common/fees' import { PrivateUser, User } from '../../common/user' import { formatMoney, formatPercent } from '../../common/util/format' @@ -98,6 +98,10 @@ const toDisplayResolution = ( if (resolution === 'MKT' && resolutions) return 'MULTI' if (resolution === 'CANCEL') return 'N/A' + const answer = (contract as FreeResponseContract).answers?.find( + (a) => a.id === resolution + ) + if (answer) return answer.text return `#${resolution}` }