fix: updated DebugMessageInfo

pull/3170/head
yougotwill 8 months ago
parent 03df7bad5b
commit b1616d4e13

@ -85,6 +85,8 @@ const DebugMessageInfo = ({ messageId }: { messageId: string }) => {
const expirationType = useMessageExpirationType(messageId);
const expirationDurationMs = useMessageExpirationDurationMs(messageId);
const expirationTimestamp = useMessageExpirationTimestamp(messageId);
const timestamp = useMessageTimestamp(messageId);
const serverTimestamp = useMessageServerTimestamp(messageId);
if (!isDevProd()) {
return null;
@ -92,29 +94,25 @@ const DebugMessageInfo = ({ messageId }: { messageId: string }) => {
return (
<>
{convoId ? (
<LabelWithInfo label={`${window.i18n('conversationId')}:`} info={convoId} />
) : null}
{messageHash ? (
<LabelWithInfo label={`${window.i18n('messageHash')}:`} info={messageHash} />
) : null}
{serverId ? (
<LabelWithInfo label={`${window.i18n('serverId')}:`} info={`${serverId}`} />
) : null}
{expirationType ? (
<LabelWithInfo label={`${window.i18n('expirationType')}:`} info={expirationType} />
{convoId ? <LabelWithInfo label={`Conversation ID:`} info={convoId} /> : null}
{messageHash ? <LabelWithInfo label={`Message Hash:`} info={messageHash} /> : null}
{serverId ? <LabelWithInfo label={`Server ID:`} info={`${serverId}`} /> : null}
{timestamp ? <LabelWithInfo label={`Timestamp:`} info={String(timestamp)} /> : null}
{serverTimestamp ? (
<LabelWithInfo label={`Server Timestamp:`} info={String(serverTimestamp)} />
) : null}
{expirationType ? <LabelWithInfo label={`Expiration Type:`} info={expirationType} /> : null}
{expirationDurationMs ? (
<LabelWithInfo
label={`${window.i18n('expirationDuration')}:`}
// formatDistanceStrict (date-fns) is not localized yet
label={`Expiration Duration:`}
// TODO formatDistanceStrict (date-fns) is not localized yet
info={`${formatDistanceStrict(0, Math.floor(expirationDurationMs / 1000))}`}
/>
) : null}
{expirationTimestamp ? (
<LabelWithInfo
label={`${window.i18n('disappears')}:`}
// format (date-fns) is not localized yet
label={`Disappears:`}
// TODO format (date-fns) is not localized yet
info={`${format(expirationTimestamp, 'PPpp')}`}
/>
) : null}

Loading…
Cancel
Save