Chats: make message_expiration optional (for Pleroma compatibility)
This commit is contained in:
parent
eeb8ca37a6
commit
239b2af553
|
@ -97,9 +97,11 @@ const ChatMessageListIntro = () => {
|
|||
) : (
|
||||
<HStack justifyContent='center' alignItems='center' space={1} className='flex-shrink-0'>
|
||||
<Icon src={require('@tabler/icons/clock.svg')} className='text-gray-600 w-4 h-4' />
|
||||
<Text size='sm' theme='muted'>
|
||||
{intl.formatMessage(messages.messageLifespan, { day: secondsToDays(chat.message_expiration) })}
|
||||
</Text>
|
||||
{chat.message_expiration && (
|
||||
<Text size='sm' theme='muted'>
|
||||
{intl.formatMessage(messages.messageLifespan, { day: secondsToDays(chat.message_expiration) })}
|
||||
</Text>
|
||||
)}
|
||||
</HStack>
|
||||
)}
|
||||
</Stack>
|
||||
|
|
|
@ -105,16 +105,18 @@ const ChatPageMain = () => {
|
|||
{chat.account?.verified && <VerificationBadge />}
|
||||
</div>
|
||||
|
||||
<Text
|
||||
align='left'
|
||||
size='sm'
|
||||
weight='medium'
|
||||
theme='primary'
|
||||
truncate
|
||||
className='w-full'
|
||||
>
|
||||
{intl.formatMessage(messages.autoDeleteMessage, { day: secondsToDays(chat.message_expiration) })}
|
||||
</Text>
|
||||
{chat.message_expiration && (
|
||||
<Text
|
||||
align='left'
|
||||
size='sm'
|
||||
weight='medium'
|
||||
theme='primary'
|
||||
truncate
|
||||
className='w-full'
|
||||
>
|
||||
{intl.formatMessage(messages.autoDeleteMessage, { day: secondsToDays(chat.message_expiration) })}
|
||||
</Text>
|
||||
)}
|
||||
</Stack>
|
||||
</HStack>
|
||||
|
||||
|
|
|
@ -87,9 +87,11 @@ const ChatWindow = () => {
|
|||
<Text size='sm' weight='bold' truncate>{chat.account.display_name}</Text>
|
||||
{chat.account.verified && <VerificationBadge />}
|
||||
</div>
|
||||
<Text size='sm' weight='medium' theme='primary' truncate>
|
||||
{intl.formatMessage(messages.autoDeleteMessage, { day: secondsToDays(chat.message_expiration) })}
|
||||
</Text>
|
||||
{chat.message_expiration && (
|
||||
<Text size='sm' weight='medium' theme='primary' truncate>
|
||||
{intl.formatMessage(messages.autoDeleteMessage, { day: secondsToDays(chat.message_expiration) })}
|
||||
</Text>
|
||||
)}
|
||||
</Stack>
|
||||
</LinkWrapper>
|
||||
</HStack>
|
||||
|
|
|
@ -44,7 +44,7 @@ export interface IChat {
|
|||
[id: number]: string
|
||||
}[]
|
||||
latest_read_message_created_at: null | string
|
||||
message_expiration: MessageExpirationValues
|
||||
message_expiration?: MessageExpirationValues
|
||||
unread: number
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue