mirror of
https://github.com/vernu/textbee.git
synced 2026-02-20 07:34:00 -05:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user