chore(web): only show message status if device is using latest version and message is sent after v2.6 release

This commit is contained in:
isra el
2025-06-11 11:27:55 +03:00
parent 50e7b7536d
commit 15a67446ea

View File

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