Skip to content
Snippets Groups Projects
Commit 71f74f58 authored by Léopold Chappuis's avatar Léopold Chappuis Committed by Adrien Béraud
Browse files

conversation-preferences: display message when no file is uploaded

Change-Id: Idb40dde8c2108743b24c4d16d88a2a7f789e06ad
parent bc9a9ce0
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ import { ...@@ -31,6 +31,7 @@ import {
Input, Input,
Popper, Popper,
Switch, Switch,
Typography,
useMediaQuery, useMediaQuery,
useTheme, useTheme,
} from '@mui/material' } from '@mui/material'
...@@ -555,7 +556,7 @@ const Files = () => { ...@@ -555,7 +556,7 @@ const Files = () => {
const { conversationId } = useConversationContext() const { conversationId } = useConversationContext()
const filesQuery = useGetAllFilesQuery(conversationId) const filesQuery = useGetAllFilesQuery(conversationId)
const files = filesQuery.data const files = filesQuery.data
const { t } = useTranslation()
const theme = useTheme() const theme = useTheme()
const isMobile = useMediaQuery(theme.breakpoints.only('xs')) const isMobile = useMediaQuery(theme.breakpoints.only('xs'))
...@@ -563,6 +564,14 @@ const Files = () => { ...@@ -563,6 +564,14 @@ const Files = () => {
;<ProcessingRequest open={true} /> ;<ProcessingRequest open={true} />
} }
if (filesQuery.isSuccess && files.length === 0) {
return (
<Box>
<Typography>{t('no_files_found')}</Typography>
</Box>
)
}
return ( return (
<Box <Box
sx={{ sx={{
......
...@@ -199,6 +199,7 @@ ...@@ -199,6 +199,7 @@
"mute_conversation": "Mute conversation", "mute_conversation": "Mute conversation",
"nameserver_already_set": "The name server is already set.", "nameserver_already_set": "The name server is already set.",
"next": "Next", "next": "Next",
"no_files_found": "No files yet.",
"ongoing_call_muted": "Ongoing call (muted)", "ongoing_call_muted": "Ongoing call (muted)",
"ongoing_call_unmuted": "Ongoing call", "ongoing_call_unmuted": "Ongoing call",
"openid": "OpenID", "openid": "OpenID",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment