Browse Source

Merge pull request #91 from vernu/fix-message-status

only show message status if device is using latest version and message is sent after v2.6 release
pull/94/head
Israel Abebe 9 months ago
committed by GitHub
parent
commit
da9efc036b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      web/app/(app)/dashboard/(components)/message-history.tsx

7
web/app/(app)/dashboard/(components)/message-history.tsx

@ -533,7 +533,7 @@ function StatusDetailsDialog({ message }: { message: any }) {
); );
} }
function MessageCard({ message, type }) {
function MessageCard({ message, type, device }) {
const isSent = type === 'sent' const isSent = type === 'sent'
const formattedDate = new Date( const formattedDate = new Date(
@ -546,6 +546,8 @@ function MessageCard({ message, type }) {
year: 'numeric', year: 'numeric',
}) })
const shouldShowStatus = device?.appVersionCode >= 14 && new Date(message?.createdAt) > new Date('2025-04-11')
return ( return (
<Card <Card
className={`hover:bg-muted/50 transition-colors max-w-sm md:max-w-none ${ className={`hover:bg-muted/50 transition-colors max-w-sm md:max-w-none ${
@ -586,7 +588,7 @@ function MessageCard({ message, type }) {
</div> </div>
<div className='flex justify-between items-center'> <div className='flex justify-between items-center'>
{isSent && (
{isSent && shouldShowStatus && (
<div className='flex items-center'> <div className='flex items-center'>
<StatusDetailsDialog message={message} /> <StatusDetailsDialog message={message} />
</div> </div>
@ -906,6 +908,7 @@ export default function MessageHistory() {
key={message._id} key={message._id}
message={message} message={message}
type={message.sender ? 'received' : 'sent'} type={message.sender ? 'received' : 'sent'}
device={devices?.data?.find((device) => device._id === currentDevice)}
/> />
))} ))}
</div> </div>

Loading…
Cancel
Save