diff --git a/src/frontend/src/features/rooms/routes/Feedback.tsx b/src/frontend/src/features/rooms/routes/Feedback.tsx index b96bfe5c..fdcbb307 100644 --- a/src/frontend/src/features/rooms/routes/Feedback.tsx +++ b/src/frontend/src/features/rooms/routes/Feedback.tsx @@ -22,6 +22,11 @@ const Heading = styled('h1', { }, }) +enum DisconnectReasonKey { + DuplicateIdentity = 'duplicateIdentity', + ParticipantRemoved = 'participantRemoved', +} + export const FeedbackRoute = () => { const { t } = useTranslation('rooms') const [, setLocation] = useLocation() @@ -32,21 +37,25 @@ export const FeedbackRoute = () => { if (!state?.reason) return switch (state.reason) { case DisconnectReason.DUPLICATE_IDENTITY: - return 'duplicateIdentity' + return DisconnectReasonKey.DuplicateIdentity case DisconnectReason.PARTICIPANT_REMOVED: - return 'participantRemoved' + return DisconnectReasonKey.ParticipantRemoved } }, []) + const showBackButton = reasonKey !== DisconnectReasonKey.ParticipantRemoved + return (
{t(`feedback.heading.${reasonKey || 'normal'}`)} - + {showBackButton && ( + + )}