Skip to content

Commit 372e922

Browse files
committed
Apply code review suggestion
1 parent 943fa69 commit 372e922

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/giftCards/GiftCardUpdate/GiftCardHistory/GiftCardTimelineEvent.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ const getEventMessage = (event: GiftCardEventType, intl: IntlShape) => {
4545
const user = getUserOrApp(event);
4646
const userUrl = getUserOrAppUrl(event);
4747

48+
// We cast to the staging GiftCardEventsEnum because the new enum (from 3.23 schema)
49+
// extends the stable one (3.22) with additional values. In 3.22, event.type will never contain
50+
// the new values, so this cast is safe. In 3.23, the staging enum will match the stable schema
51+
// and the cast becomes a no-op.
52+
// TODO: Remove this cast when 3.23 is released and the stable schema includes the new enum values.
4853
switch (event.type as GiftCardEventsEnum) {
4954
case GiftCardEventsEnum.ACTIVATED:
5055
return user

0 commit comments

Comments
 (0)