Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

🚸(frontend) hide back button when a user is ejected by an admin

lebaudantoine594bd5a69230
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 (
<Screen layout="centered" footer={false}>
<Center>
<VStack>
<Heading>{t(`feedback.heading.${reasonKey || 'normal'}`)}</Heading>
<HStack>
- <Button variant="secondary" onPress={() => window.history.back()}>
- {t('feedback.back')}
- </Button>
+ {showBackButton && (
+ <Button variant="secondary" onPress={() => window.history.back()}>
+ {t('feedback.back')}
+ </Button>
+ )}
<Button variant="primary" onPress={() => setLocation('/')}>
{t('feedback.home')}
</Button>